home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 2 / Gekikoh Dennoh Club Vol. 2 (Japan).7z / Gekikoh Dennoh Club Vol. 2 (Japan) (Track 01).bin / games / px3 / px.bas < prev    next >
BASIC Source File  |  1997-09-19  |  121KB  |  5,017 lines

  1. /*====-----------------------------------------====    Line:1230 PX main
  2. /*====  -: Picture Crosswords [ PX ] :-        ====    Line:2694 Editor sub
  3. /*====    St.'96-04-10 ~ Stop'96-06-15        ====
  4. /*====       '96-07-26 ~ Ed.'96-10-15         ====
  5. /*====       '96-10-31                         ====
  6. /*====       '96-12-17 2nd. release            ====
  7. /*====       '97-09-19 3rd. release            ====
  8. /*====                     Programmed by MSY.  ====
  9. /*====-----------------------------------------====
  10. int     i,j,wk0,wk1,wk2,wk3
  11. char     ST1,BT1,ston,bton,stot,sttmf,sths
  12.  
  13. char     cx,cy,cxn,cyn                /* カーソル
  14. char     px,py
  15. char     cx_,cy_                /* cx*6,cy*6
  16. char     cmx,cmy,cmxn,cmyn
  17. dim int  mvof(23)={0,-1, 0, 1,-1,0, 1,-1, 0, 1    /* move table.(8way.)
  18.           ,0, 1, 1, 1, 0,0, 0,-1,-1,-1}
  19.  
  20. char     cs_grd                    /* カーソル グラデーション
  21. dim char piko(1)
  22. char     kyb
  23. char     dbg=0,dskok
  24.  
  25. char     g_mode                    /* game mode
  26. char     p_mode                    /* play mode
  27. char     pnlt=0                    /* penalty
  28. dim char pnl_of(7)={&H59,3,&H59,3, &H2E,3,&H00,0}
  29. dim char rb_p(17)={164,164,164,164,206,206,164,164,206
  30.           ,206,164,164,206,206,164,164,164,164}
  31. char     ps_x,ps_y
  32. char     pic_x,pic_y
  33. char     help_p                    /* ヘルプ
  34. char     stage=0                /* ステージ ナンバー
  35. char     try_c
  36. int     recd
  37. int     tim_c,tim_w                /* タイム カウンタ
  38. dim char flg_map(899)                /* ジョウタイ マップ
  39. char     flg_on_mode
  40. int     stg_cmp
  41. char     tit_on
  42. char     stg_p=0
  43. char     bgm_no=0,bgm_no_bk            /* bgm number
  44. char     inft=0                    /* info. type
  45. char     svld=0,ldok                /* save/load
  46. int     dsp_x,dsp_y
  47. char     tile=1                    /* タイル ニ スル?
  48. dim int  dsp_of(31)={284,281,279,276,274,271,269,256    /* カンセイズ オフセット
  49.             ,408,393,378,363,348,333,318,256
  50.  
  51.             ,304,299,294,289,284,279,274,256
  52.             , 56, 51, 46, 41, 36, 31, 26,256}
  53. dim char star_x(15),star_y(15)            /* クリアーガメン ホシ ノ ザヒョウ
  54. dim char pyon(7)={136,128,124,120,122,124,128,136}
  55.  
  56. dim char stg_data(51199)
  57. dim char user_data(51199)
  58.  
  59. char     pen_mode                /* エディット モード
  60. char     pen_c                    /* エディット アクティブ カラー
  61. char     pc_r,pc_g,pc_b
  62. char     xsize=5,ysize=5            /* モンダイ ノ サイズ
  63. dim char edit_map(899)
  64. dim int  edit_palet(7)={2114,30844,22420,3964,55362,59516,61314,63420}
  65. dim int  edit_palet_def(7)={2114,30844,22420,3964,55362,59516,61314,63420}
  66. char     flbt=0                    /* fill bit
  67. char     n_head                    /* title input
  68. char     ni_x,ni_y
  69. dim char stg_name(15)
  70. dim char fnt_l(259)={
  71.     &H00,  1,  2,  3,  4,  5,  6,  7,  8,  9, 71, 72, 73, 74, 75,152,153,154,155,156
  72.     , 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 76, 77, 78, 79, 80,157,158,159,160,161
  73.     , 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 81, 82, 83, 84, 85,162,163,164,165,166
  74.     , 30, 31, 32, 33, 34, 35,224,225,226,227, 86, 87, 88, 89, 90,167,168,169,170,171
  75.     , 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 91, 92, 93, 94, 95,172,173,174,175,176
  76.     , 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 96, 97, 98, 99,100,177,178,179,180,181
  77.     , 56, 57, 58, 59, 60, 61,232,233,240,241,101,102,103,104,105,182,183,184,185,186
  78.     ,228,229,230,231,234,235,236,237,238,239,106,248,107,249,108,187,252,188,253,189
  79.     ,118,119,120,121,122,199,200,201,202,203,109,110,111,112,113,190,191,192,193,194
  80.     ,123,124,125,126,127,204,205,206,207,208,114,115,116,117, 70,195,196,197,198,151
  81.     ,128,129,130,131,132,209,210,211,212,213, 62, 63, 64, 65, 66,143,144,145,146,147
  82.     ,133,134,135,136,137,214,215,216,217,218, 67,250, 68,251, 69,148,254,149,247,150
  83.     ,138,139,140,141,142,219,220,221,222,223,242,243,244,245,246,255,255,255,255,255}
  84. char     shf=0                    /* shift
  85. dim str  shf_s(3)[5]={"UP___","DOWN_","LEFT_","RIGHT"}
  86. char     swp_s0=0,swp_s1=0            /* swap
  87. char     mir=0                    /* mirror
  88. dim str  mir_s(1)[3]={"UaD","LaR"}
  89.  
  90. char     h_head,h_err
  91. char     hwk0,hwk1,hwk2,hwk3
  92. dim char hint_buff(15)
  93. dim char h_bit(1)
  94. dim char hint_x(329)
  95. dim char hint_y(329)
  96.  
  97. str stg_fl[8]
  98. dim char PAL(287),PCG1(37119)
  99. dim int  R_TXT(255)
  100. dim char wk9(127),wkA(899),FLW(255),NOP(255)
  101. dim char BLK0(35),BLK1(35),BLK2(35),MK0(23),MK1(23),PEK(899)
  102. dim char CB0(35),CB1(35),CB2(35),CB3(35),CB4(35),CB5(35),CB6(35),CB7(35)
  103. dim char CBS0(35),CBS1(35),CBS2(35),CBS3(35),CBS4(35),CBS5(35),CBS6(35),CBS7(35)
  104. dim char BK0(255)
  105. dim char BK2(255),BK2_(255),BK3(255),BK3_(255)
  106. dim char BK4(1023),BK4S0(127),BK4S1(127)
  107. dim char BK5(255),BK5_(255)
  108. dim char TBK0(255),TBK0_(255),TBK1(255),TBK1_(255),TBK2(255),TBK2_(255)
  109. dim char TBK3(255),TBK3_(255),TBK3__(255)
  110. dim char TBK4(255),TBK4_(255),TBK4__(255)
  111. dim char REPT0(63),REPT1(63),REPT2(63),REPT3(63)
  112. dim char REPT4(63),REPT5(63),REPT6(63),REPT7(63)
  113. dim char HLPM(895)
  114. dim char DSP_MN(1599),DSP_CL(1599),DSP_BK(511)
  115. dim char PROB0(255),PROB1(255)
  116.  
  117. dim str  zmd_list(23)={
  118.     "NEIRO.ZMD",
  119.     "SE0.ZMD","SE1.ZMD","SE2.ZMD","SE3.ZMD",
  120.     "SE4.ZMD","SE5.ZMD","SE6.ZMD","SE7.ZMD",
  121.     "",
  122.     "PT001MK_.ZMD","PT008MK_.ZMD","PT009MK_.ZMD","PT012MK_.ZMD",
  123.     "PT014MK_.ZMD",
  124.     "PT006MK_.ZMD","PT010MK_.ZMD","PT015MK_.ZMD","PT002MK_.ZMD",
  125.     "PT003MK_.ZMD","PT005MK_.ZMD","PT007MK_.ZMD","PT011MK_.ZMD",
  126.     "SILENT.ZMD"}
  127. /*-*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
  128. DATA_READ()                    /* ETC. data read
  129. SCR_INIT()                    /* screen init.
  130. GPAL_SET()                    /* graphics palet set
  131. PCG_SET()                    /* objects set
  132. SCR_MK1()                    /* screen make
  133.  
  134. /*---- -: Main Loop :- ----
  135. while 1
  136.     TITLE()
  137.     if kyb = &H1B or g_mode = 4 then break
  138.  
  139.     if g_mode = 0 then {
  140.         p_mode=0
  141.         GAME()                /* game loop
  142.     }
  143.     if g_mode = 1 then {
  144.         if p_mode = 0 then {
  145.             EDITOR()        /* editor
  146.         } else {
  147.             g_mode=0
  148.             GAME()            /* edit play
  149.         }
  150.     }
  151.     if g_mode = 2 or g_mode = 3 then RULE()    /* rule disp.
  152. endwhile
  153.  
  154. m_stop()
  155. tcls()
  156. end
  157.  
  158. /*[T]= -: Title :- ====
  159. /*====-------------====
  160. /* use sp.plane : 0 - 15 > pic・・・
  161. /*        : 16 - 39 > title logo
  162. /*        : 40 > cursole
  163. /*        : 41 - 44,71 - 74 > "play","load"
  164. /*        : 45 - 52 > "edit","play"
  165. /*        : 53 - 56 > "rule"
  166. /*        : 57 - 66 > "penalty","on/off"
  167. /*        : 67 - 70 > "exit"
  168. func TITLE()
  169.     home(0,  0,  0) : home(1,256,  0)
  170.     contrast(0)
  171.     p_mode=0
  172.     TITLE_MK()                /* screen make.
  173.  
  174.     vpage(3) : sp_disp(1) : TX_DISP(1)
  175.     contrast(15)
  176.     play_zmd(10)                /* play "title bgm"
  177.     cmy=0
  178.     tim_c=0
  179.  
  180. /*---- -: Title Main :- ----
  181.     kb_cls()
  182.     ston=&HFF
  183.     sths=&HFF
  184.     bton=kstrig(1)
  185.     while tim_c <> 900
  186.         tim_c=tim_c+1
  187.         ST_INP()
  188.  
  189.         if kyb = &H1B then break    /* return to os.
  190.  
  191. /*---- -: カーソル ピコピコ :- ----
  192.         piko(0)=piko(0)+1 and 3
  193.         if piko(0) = 0 then {
  194.             piko(1)=piko(1)+1 and 3
  195.         }
  196.  
  197. /*++++ -: カーソル イドウ :- ++++
  198.         cmyn=cmy
  199.         if ston = 0 then {
  200.         if ST1 <> 0 and sths = ST1 then {
  201.             if ST1 = 2 or ST1 = 8 then {
  202.                 play_se(1)
  203.                 cmy=cmy+mvof(ST1+10)
  204.                 if cmy = &HFF then cmy=4
  205.                 if cmy = 5 then cmy=0
  206.                 tim_c=0
  207.             }
  208.  
  209.             if ST1 = 4 or ST1 = 6 then {
  210.                 if cmy = 0 and ldok = 1 then {
  211.                     play_se(1)
  212.                     svld=svld+1 and 1
  213.                     sp_scrl( 71,200,152,&H361,svld)    /* "SP":load
  214.                     sp_scrl( 72,208,152,&H367,svld)
  215.                     sp_scrl( 73,216,152,&H363,svld)
  216.                     sp_scrl( 74,224,152,&H32D,svld)
  217.                 }
  218.                 if cmy = 1 then {
  219.                     play_se(1)
  220.                     p_mode=p_mode+1 and 1
  221.                     sp_scrl( 49,200,168,&H45C,p_mode)    /* "SP":play
  222.                     sp_scrl( 50,208,168,&H461,p_mode)
  223.                     sp_scrl( 51,216,168,&H463,p_mode)
  224.                     sp_scrl( 52,224,168,&H42F,p_mode)
  225.                 }
  226.                 if cmy = 3 then {
  227.                     play_se(1)
  228.                     pnlt=pnlt+1 and 1
  229.                     sp_scrl( 65,232,200,&H600+pnl_of((pnlt shl 2)  ),pnl_of((pnlt shl 2)+1))    /* "SP":on/off
  230.                     sp_scrl( 66,240,200,&H600+pnl_of((pnlt shl 2)+2),pnl_of((pnlt shl 2)+3))
  231.                 }
  232.                 tim_c=0
  233.             }
  234.         }
  235.         }
  236.         sp_scrl( 40,148+piko(1),156+(cmy shl 4)-piko(1),&H414C,3)    /* "SP":テ カーソル
  237.  
  238. /*++++ -: モード ケッテイ :- ++++
  239.         if bton = 0 and BT1 = 1 and cmy <> 3 then {
  240.             play_se(3)
  241.             g_mode=cmy
  242.             break
  243.         }
  244.  
  245.         if bton = 0 and BT1 = 2 then {
  246.             play_se(3)
  247.             bton=BT1
  248.             TIT_S1()
  249.         }
  250.  
  251. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  252.         ST_CK2(16,2)
  253.  
  254. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  255.         if bton <> BT1 then bton=0
  256.  
  257.         sp_out()
  258.     endwhile
  259.     if tim_c = 900 then {
  260.         contrast(0)
  261.         g_mode=3            /* キョウセイ rule
  262.     }
  263.  
  264.     m_fadeout(40)                /* music fadeout
  265.  
  266.     SCR_ALL_OFF()
  267. endfunc
  268.  
  269. /*[T]= -: Problem File Change :- ====
  270. /*====---------------------------====
  271. func TIT_S1()
  272.     char na=0
  273.     apage(0)
  274.     for i=0 to 5
  275.         wk0=(i shl 4)+24
  276.         put(wk0,168,wk0+15,183,BK0)
  277.         put(wk0,184,wk0+15,199,BK0)
  278.     next
  279.     tfill( 24,168,119,199, 8)
  280.     tfill( 25,169,118,198,15)
  281.     tfill( 26,170,117,197, 8)
  282.     tfill( 27,171,116,196, 0)
  283.     TFP( 34,172,"I") : TFP( 28,172,"F") : TFP( 40,172,"LE_CHANGE")
  284.     TFP( 44,184,"PX[STG0") : TFP( 60,186,"[")
  285.  
  286.     kb_cls()
  287.     ston=&HFF
  288.     sths=&HFF
  289.     while 1
  290.         ST_INP()
  291.  
  292. /*++++ -: カーソル イドウ :- ++++
  293.         if ston = 0 then {
  294.             if ST1 <> 0 and (ST1 and 1) = 0 and sths = ST1 then {
  295.                 play_se(1)
  296.                 na=na+mvof(ST1)-mvof(ST1+10) and 15
  297.                 TFP( 92,184,hex$(na))
  298.             }
  299.         }
  300.  
  301. /*++++ -: モード ケッテイ :- ++++
  302.         if bton = 0 and BT1 = 1 then {
  303. /*----- -: ファイル ガ アルカ チェック :- ----
  304.             wk0=filesnum("PX_STG"+hex$(na)+".DAT",&H20)
  305.             if wk0 <> 0 then {
  306.                 play_se(3)
  307.                 bton=BT1
  308.                 break
  309.             } else {
  310.                 play_se(6)
  311.                 bton=BT1
  312.             }
  313.         }
  314.  
  315.         if bton = 0 and BT1 = 2 then {
  316.             play_se(2)
  317.             bton=BT1
  318.             break
  319.         }
  320.  
  321. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  322.         ST_CK2(16,2)
  323.  
  324. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  325.         if bton <> BT1 then bton=0
  326.  
  327.         sp_out()
  328.     endwhile
  329.  
  330.     if BT1 = 1 then {
  331. /*----- -: ファイル ガ アルカ チェック :- ----
  332.         wk0=filesnum("PX_STG"+hex$(na)+".DAT",&H20)
  333.         if wk0 <> 0 then {
  334. /*----- -: アッタ! :- ----
  335.             stg_fl="PX_STG"+hex$(na)
  336.             wk0=fopen(stg_fl+".DAT","r")
  337.             fread(stg_data,51200,wk0)
  338.             fclose(wk0)
  339.  
  340.             ldok=filesnum(stg_fl+".RES",&H20)
  341.             if ldok = 0 and svld = 1 then {
  342.                 svld=0
  343.                 sp_scrl(71,0,0,0,0)
  344.                 sp_scrl(72,0,0,0,0)
  345.                 sp_scrl(73,0,0,0,0)
  346.                 sp_scrl(74,0,0,0,0)
  347.             }
  348.         } else {
  349.             beep            /* ナカッタ!
  350.         }
  351.     }
  352.  
  353.     apage(0)
  354.     fill( 24,168,119,199,  0)
  355.     tfill( 24,168,119,199, 0)
  356.     tim_c=0
  357. endfunc
  358.  
  359. /*[T]= -: Title Display Make :- ====
  360. /*====--------------------------====
  361. func TITLE_MK()
  362.     char n0,n1,n2,n3,n4
  363.     apage(0)                /* active "0" make
  364. /*---- -: Type-A
  365. /*    for i=0 to 15
  366. /*        box(i,i,255-i,255-i,177+(i shl 1))
  367. /*    next
  368. /*---- -: Type-B
  369.     for i=0 to 15
  370.         n0=16-i : n1=239+i
  371.         n2=8-(i shr 1) : n3=247+(i shr 1)
  372.         n4=207-(i shl 1)
  373.         box(  0,  0,255,255,n4)
  374.  
  375.         line(n0,n0,n2,127,n4) : line(n0,n1,n2,128,n4)
  376.         line(n1,n0,n3,127,n4) : line(n1,n1,n3,128,n4)
  377.         line(n0,n0,127,n2,n4) : line(n1,n0,128,n2,n4)
  378.         line(n0,n1,127,n3,n4) : line(n1,n1,128,n3,n4)
  379.  
  380.         paint( 15-i, 15-i,n4)
  381.         paint( 15-i,240+i,n4)
  382.         paint(240+i, 15-i,n4)
  383.         paint(240+i,240+i,n4)
  384.     next
  385.  
  386. /*---- -: object set :- ----
  387.     sp_scrl(  0, 40, 48,&H35C,3)        /* "SP":picture
  388.     sp_scrl(  1, 48, 48,&H42A,3)
  389.     sp_scrl(  2, 56, 48,&H560,3)
  390.     sp_scrl(  3, 64, 48,&H66A,3)
  391.     sp_scrl(  4, 72, 48,&H72B,3)
  392.     sp_scrl(  5, 80, 48,&H864,3)
  393.     sp_scrl(  6, 88, 48,&H362,3)
  394.     sp_scrl(  7,104, 48,&H460,3)        /* "SP":crossword
  395.     sp_scrl(  8,112, 48,&H564,3)
  396.     sp_scrl(  9,120, 48,&H667,3)
  397.     sp_scrl( 10,128, 48,&H769,3)
  398.     sp_scrl( 11,136, 48,&H869,3)
  399.     sp_scrl( 12,144, 48,&H32C,3)
  400.     sp_scrl( 13,152, 48,&H467,3)
  401.     sp_scrl( 14,160, 48,&H564,3)
  402.     sp_scrl( 15,168, 48,&H62D,3)
  403.     for i=0 to 3                /* "SP":PX logo
  404.         sp_scrl( 16+i, 80+(i shl 4), 72,&H370+i,3)
  405.         sp_scrl( 20+i, 80+(i shl 4), 88,&H374+i,3)
  406.         sp_scrl( 24+i, 84+(i shl 4), 76,&H470+i,3)
  407.         sp_scrl( 28+i, 84+(i shl 4), 92,&H474+i,3)
  408.         sp_scrl( 32+i, 76+(i shl 4), 68,&H570+i,3)
  409.         sp_scrl( 36+i, 76+(i shl 4), 84,&H574+i,3)
  410.     next
  411.     sp_scrl( 41,160,152,&H35C,3)        /* "SP":play
  412.     sp_scrl( 42,168,152,&H361,3)
  413.     sp_scrl( 43,176,152,&H363,3)
  414.     sp_scrl( 44,184,152,&H32F,3)
  415.         sp_scrl( 71,200,152,&H361,svld)    /* "SP":load
  416.         sp_scrl( 72,208,152,&H367,svld)
  417.         sp_scrl( 73,216,152,&H363,svld)
  418.         sp_scrl( 74,224,152,&H32D,svld)
  419.     sp_scrl( 45,160,168,&H462,3)        /* "SP":edit
  420.     sp_scrl( 46,168,168,&H42D,3)
  421.     sp_scrl( 47,176,168,&H42A,3)
  422.     sp_scrl( 48,184,168,&H46A,3)
  423.         sp_scrl( 49,200,168,&H45C,p_mode)    /* "SP":play
  424.         sp_scrl( 50,208,168,&H461,p_mode)
  425.         sp_scrl( 51,216,168,&H463,p_mode)
  426.         sp_scrl( 52,224,168,&H42F,p_mode)
  427.     sp_scrl( 53,160,184,&H564,3)        /* "SP":rule
  428.     sp_scrl( 54,168,184,&H52B,3)
  429.     sp_scrl( 55,176,184,&H561,3)
  430.     sp_scrl( 56,184,184,&H562,3)
  431.     sp_scrl( 57,160,200,&H65C,3)        /* "SP":penalty
  432.     sp_scrl( 58,168,200,&H662,3)
  433.     sp_scrl( 59,176,200,&H62E,3)
  434.     sp_scrl( 60,184,200,&H663,3)
  435.     sp_scrl( 61,192,200,&H661,3)
  436.     sp_scrl( 62,200,200,&H66A,3)
  437.     sp_scrl( 63,208,200,&H62F,3)
  438.         sp_scrl( 64,224,200,&H667,3)    /* "SP":on/off
  439.         sp_scrl( 65,232,200,&H600+pnl_of((pnlt shl 2)  ),pnl_of((pnlt shl 2)+1))
  440.         sp_scrl( 66,240,200,&H600+pnl_of((pnlt shl 2)+2),pnl_of((pnlt shl 2)+3))
  441.     sp_scrl( 67,160,216,&H762,3)        /* "SP":exit
  442.     sp_scrl( 68,168,216,&H75E,3)
  443.     sp_scrl( 69,176,216,&H72A,3)
  444.     sp_scrl( 70,184,216,&H76A,3)
  445.     sp_out()
  446.     TFP( 52,232,"ALL_RIGHTS_RESERVED")
  447.     TFP( 72,225,"`") : TFP( 80,224,"1996[1997_MSY]")
  448. endfunc
  449.  
  450. /*[G]= -: Play :- ====
  451. /*====------------====
  452. func GAME()
  453.     if p_mode = 0 then stage=0
  454.     pen_mode=0
  455.  
  456. /*---- -: Play Mode Main Loop :- ----
  457.     while 1
  458.         if svld = 1 and p_mode = 0 then {
  459.             RES_LD1()        /* load
  460.         } else {
  461.             svld=0
  462.             SELECT()        /* モンダイ セレクト
  463.         }
  464.         if kyb = &H1B then break    /* ret. to title
  465.  
  466.         G_INIT()            /* start init.
  467.         RES_LD2()
  468.         BK_PAL_SET()            /* back graphics palet
  469.  
  470.         GAME_ST()            /* start!
  471.         PX_MAIN()            /* main
  472.         if kyb = &H1B then break    /* ret. to title
  473.         if g_mode = 99 then {
  474.             GAME_OVER()        /* game over
  475.             break
  476.         }
  477.         STG_CLR()            /* clear!
  478.         if kyb = &H1B then break    /* ret. to title
  479.         CMP_PIC_DIS()            /* カンセイズ ヒョウジ
  480.         if kyb = &H1B then break    /* ret. to title
  481.  
  482.         if p_mode = 1 then break    /* edit-play exit
  483.     endwhile
  484.  
  485.     SCR_ALL_OFF()
  486.     apage(1)
  487.     fill(  8,  8, 39, 39,  4)
  488.     sp_palet( 0,PAL, 0)
  489.     sp_out()
  490. endfunc
  491.  
  492. /*[G]= -: Problem Select :- ====
  493. /*====----------------------====
  494. /* use sp.plane : 0 - 12 > logo
  495. /*        : 13-14,15-17 > no
  496. /*        : 18-19,20-23 > x,y size
  497. /*        : 24-28 > title
  498. /*        : 29-31,32-33 > try
  499. /*        : 34-39,40-44 > record
  500. /*        : 45-48 > cursole
  501. /*        : 50-79 > ???
  502. /*        : 80-105 > etc.
  503. /*        : 106-110 > sorry
  504. /*        : 111-114 > size
  505. func SELECT()
  506.     home(0,256,  0) : home(1,  0,256)
  507.     SEL_MK()                /* screen make
  508.     tit_on=0
  509.     apage(0)
  510.     put(344+(ps_x shl 4), 96+(ps_y shl 4),359+(ps_x shl 4),111+(ps_y shl 4),PROB0)
  511.     ps_x=stage mod 10
  512.     ps_y=stage/10
  513.     put(344+(ps_x shl 4), 96+(ps_y shl 4),359+(ps_x shl 4),111+(ps_y shl 4),PROB1)
  514.     sp_scrl( 45,112+(ps_x shl 4),120+(ps_y shl 4),&H14C,3)    /* "SP":オテテ
  515. /*    sp_out()
  516.  
  517.     vpage(3) : sp_disp(1) : TX_DISP(1)
  518.     play_zmd(11)                /* play "select bgm"
  519.  
  520. /*---- -: problem select main :- ----
  521.     kb_cls()
  522.     ston=&HFF
  523.     sths=&HFF
  524.     bton=kstrig(1)
  525.     while 1
  526.         ST_INP()
  527.  
  528.         if kyb = &H1B then break    /* ret. to title
  529.  
  530. /*---- -: カーソル ピコピコ :- ----
  531.         piko(0)=piko(0)+1 and 3
  532.         if piko(0) = 0 then {
  533.             piko(1)=piko(1)+1 and 3
  534.         }
  535.  
  536. /*++++ -: カーソル イドウ :- ++++
  537.         cxn=ps_x
  538.         cyn=ps_y
  539.  
  540.         if ston = 0 then {
  541.         if ST1 <> 0 and sths = ST1 then {
  542.             ps_x=ps_x+mvof(ST1)
  543.             ps_y=ps_y+mvof(ST1+10)
  544.             if ps_x = &HFF then {
  545.                 ps_x=9
  546.                 ps_y=ps_y-1
  547.             }
  548.             if ps_x >= 10 then {
  549.                 ps_x=0
  550.                 ps_y=ps_y+1
  551.             }
  552.             if ps_y = &HFF then ps_y=9
  553.             if ps_y >= 10 then ps_y=0
  554.  
  555.             if ps_x <> cxn or ps_y <> cyn then {
  556.                 play_se(1)
  557.                 apage(0)
  558.                 put(344+(cxn shl 4), 96+(cyn shl 4),359+(cxn shl 4),111+(cyn shl 4),PROB0)
  559.                 put(344+(ps_x shl 4), 96+(ps_y shl 4),359+(ps_x shl 4),111+(ps_y shl 4),PROB1)
  560.                 stage=ps_y*10+ps_x
  561.                 SEL_S1()    /* problem status disp.
  562.             }
  563.         }
  564.         }
  565.         sp_scrl( 45,112+(ps_x shl 4)-piko(1),120+(ps_y shl 4)-piko(1),&H14C,3)    /* "SP":オテテ
  566.  
  567.         if ST1 = 0 then {
  568.             if tit_on = 0 then {
  569.                 SEL_S2()    /* title disp.
  570.             }
  571.             if tit_on = 1 then {
  572.                 SEL_S3()    /* picture disp.
  573.             }
  574.         }
  575.  
  576.         if bton <> BT1 then {
  577. /*++++ -: "A" ボタン ガ オサレタトキ :- ++++
  578.             if BT1 = 1 then {
  579.                 if tit_on = &HEF then {
  580.                     play_se(6)
  581.                     bton=BT1
  582.                 } else {
  583.                     play_se(3)
  584.                     bton=BT1
  585.                     break
  586.                 }
  587.             }
  588.  
  589. /*++++ -: "B" ボタン ガ オサレタトキ :- ++++
  590.             if BT1 = 2 then {
  591.                 play_se(2)
  592.                 kyb=&H1B
  593.                 bton=BT1
  594.                 break
  595.             }
  596.         }
  597.  
  598. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  599.         ST_CK2(16,2)
  600.  
  601. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  602.         if bton <> BT1 then bton=0
  603.  
  604.         sp_out()
  605.     endwhile
  606.  
  607.     m_fadeout(40)
  608.     SCR_ALL_OFF()
  609. endfunc
  610.  
  611. /*[G]= -: Problem Select Display Make :- ====
  612. /*====-----------------------------------====
  613. func SEL_MK()
  614.     apage(1)                /* active "1" make.
  615.     if p_mode = 0 then {
  616.         for i=0 to 7
  617.             wk0=(i shl 5)+256
  618.             for j=0 to 7
  619.                 wk1=(j shl 5)
  620.                 put(wk1   ,wk0   ,wk1+15,wk0+15,BK5)
  621.                 put(wk1   ,wk0+16,wk1+15,wk0+31,BK5_)
  622.                 put(wk1+16,wk0   ,wk1+31,wk0+15,BK5_)
  623.                 put(wk1+16,wk0+16,wk1+31,wk0+31,BK5)
  624.             next
  625.         next
  626.     } else {
  627.         for i=0 to 7
  628.             wk0=(i shl 5)+256
  629.             for j=0 to 7
  630.                 wk1=(j shl 5)
  631.                 put(wk1   ,wk0   ,wk1+15,wk0+15,BK3)
  632.                 put(wk1   ,wk0+16,wk1+15,wk0+31,BK3_)
  633.                 put(wk1+16,wk0   ,wk1+31,wk0+15,BK3_)
  634.                 put(wk1+16,wk0+16,wk1+31,wk0+31,BK3)
  635.             next
  636.         next
  637.     }
  638.  
  639. /*---- -: object set :- ----
  640.     sp_scrl(  0, 32, 16,&H35C,3)        /* "SP":problem
  641.     sp_scrl(  1, 48, 16,&H464,3)
  642.     sp_scrl(  2, 64, 16,&H567,3)
  643.     sp_scrl(  3, 80, 16,&H65D,3)
  644.     sp_scrl(  4, 96, 16,&H761,3)
  645.     sp_scrl(  5,112, 16,&H862,3)
  646.     sp_scrl(  6,128, 16,&H366,3)
  647.     sp_scrl(  7,160, 16,&H469,3)        /* "SP":select
  648.     sp_scrl(  8,176, 16,&H562,3)
  649.     sp_scrl(  9,192, 16,&H661,3)
  650.     sp_scrl( 10,208, 16,&H762,3)
  651.     sp_scrl( 11,224, 16,&H860,3)
  652.     sp_scrl( 12,240, 16,&H36A,3)
  653.     sp_scrl( 13,104, 36,&H32E,3)        /* "SP":no
  654.     sp_scrl( 14,112, 36,&H367,3)
  655.     sp_scrl( 18,200, 36,&H85E,3)        /* "SP":x/y
  656.     sp_scrl( 19,232, 36,&H82F,3)
  657.     sp_scrl(111,160, 36,&H469,3)        /* "SP"size,
  658.     sp_scrl(112,168, 36,&H42A,3)
  659.     sp_scrl(113,176, 36,&H41F,3)
  660.     sp_scrl(114,184, 36,&H462,3)
  661.     sp_scrl(115,224, 36,&H45F,3)
  662.     sp_scrl( 24,104, 56,&H66A,3)        /* "SP":title
  663.     sp_scrl( 25,112, 56,&H62A,3)
  664.     sp_scrl( 26,120, 56,&H66A,3)
  665.     sp_scrl( 27,128, 56,&H661,3)
  666.     sp_scrl( 28,136, 56,&H662,3)
  667.     sp_scrl( 29,104, 76,&H56A,3)        /* "SP":try
  668.     sp_scrl( 30,112, 76,&H564,3)
  669.     sp_scrl( 31,120, 76,&H52F,3)
  670.     sp_scrl( 34,160, 76,&H564,3)        /* "SP":record
  671.     sp_scrl( 35,168, 76,&H562,3)
  672.     sp_scrl( 36,176, 76,&H560,3)
  673.     sp_scrl( 37,184, 76,&H567,3)
  674.     sp_scrl( 38,192, 76,&H564,3)
  675.     sp_scrl( 39,200, 76,&H52D,3)
  676.     sp_scrl( 42,232, 76,&H557,3)
  677.     for i=0 to 8                /* "SP":ヨコ ノ スウジ
  678.         sp_scrl( 50+i,104+(i shl 4), 96,&H421+i,3)
  679.     next
  680.     sp_scrl( 59,244, 96,&H421,3)
  681.     sp_scrl( 60,252, 96,&H420,3)
  682.     sp_scrl( 61, 88,112,&H320,3)        /* "SP":タテ ノ スウジ
  683.     for i=0 to 8
  684.         sp_scrl( 62+(i shl 1), 82,128+(i shl 4),&H321+i,3)
  685.         sp_scrl( 63+(i shl 1), 90,128+(i shl 4),&H320  ,3)
  686.     next
  687.     sp_scrl( 80, 20,112,&H55C,3)        /* "SP":picture
  688.     sp_scrl( 81, 28,112,&H52A,3)
  689.     sp_scrl( 82, 36,112,&H560,3)
  690.     sp_scrl( 83, 44,112,&H56A,3)
  691.     sp_scrl( 84, 52,112,&H52B,3)
  692.     sp_scrl( 85, 60,112,&H564,3)
  693.     sp_scrl( 86, 68,112,&H562,3)
  694.     sp_scrl( 92, 24,180,&H15A,3)        /* "SP":joy stick
  695.     sp_scrl( 93, 24,196,&H15B,3)
  696.     sp_scrl( 87, 28,196,&H14C,3)        /* "SP":?move
  697.     sp_scrl( 88, 40,196,&H366,3)
  698.     sp_scrl( 89, 48,196,&H367,3)
  699.     sp_scrl( 90, 56,196,&H368,3)
  700.     sp_scrl( 91, 64,196,&H362,3)
  701.     sp_scrl( 94, 24,212,&H663,3)        /* "SP":a-button
  702.     sp_scrl( 95, 24,220,&H16D,3)
  703.     sp_scrl( 96, 40,220,&H45C,3)        /* "SP":play
  704.     sp_scrl( 97, 48,220,&H461,3)
  705.     sp_scrl( 98, 56,220,&H463,3)
  706.     sp_scrl( 99, 64,220,&H42F,3)
  707.     sp_scrl(100, 24,236,&H55D,3)        /* "SP":b-button
  708.     sp_scrl(101, 24,244,&H16D,3)
  709.     sp_scrl(102, 40,244,&H862,3)        /* "SP":exit
  710.     sp_scrl(103, 48,244,&H85E,3)
  711.     sp_scrl(104, 56,244,&H82A,3)
  712.     sp_scrl(105, 64,244,&H86A,3)
  713.  
  714. /*---- -: トイテイル モンダイ ニ ハナ ヲ ソエル :- ----
  715.     if p_mode = 0 then {
  716.         for i=0 to 9
  717.         for j=0 to 9
  718.             wk0=(i*10+j) shl 9
  719.             if stg_data(wk0) = 0 then {
  720.                 tput( 89+(j shl 4), 97+(i shl 4),16,16,NOP,"pset")
  721.             } else {
  722.                 if (stg_data(wk0+ 34) and 1) = 1 then {
  723.                     tput( 86+(j shl 4), 94+(i shl 4),16,16,FLW,"xor")
  724.                 }
  725.             }
  726.         next
  727.         next
  728.     } else {
  729.         for i=0 to 9
  730.         for j=0 to 9
  731.             if user_data(((i*10+j) shl 9)) = 0 then {
  732.                 tput( 89+(j shl 4), 97+(i shl 4),16,16,NOP,"pset")
  733.             }
  734.         next
  735.         next
  736.     }
  737.  
  738.     SEL_S1()                /* problem status disp.
  739. /*    SEL_S2()
  740.     tfill( 12, 20, 83, 91, 8)        /* picture ワク
  741.     tfill( 13, 21, 82, 90,15)
  742.     tfill( 14, 22, 81, 89,14)
  743.     tfill( 15, 23, 80, 88, 8)
  744.     tfill( 16, 24, 79, 87, 0)
  745.  
  746.     tfill(134, 37,249, 58, 8)        /* title ワク
  747.     tfill(135, 38,248, 57,15)
  748.     tfill(136, 39,247, 56, 8)
  749.     tfill(137, 40,246, 55, 0)
  750.     sp_out()
  751. endfunc
  752.  
  753. /*[G]= -: Problem Status :- ====
  754. /*====----------------------====
  755. func SEL_S1()
  756. /*---- -: normal/user :- ----
  757.     SSP3( 15,128, 36,stage+1,&H720,3)    /* stage number
  758.     if p_mode = 0 then {
  759. /*---- -: normal mode status :- ----
  760.         xsize=stg_data((stage shl 9)    )    /* x-size
  761.         SSP2( 20,208, 36,xsize,&H720,0)
  762.         ysize=stg_data((stage shl 9)+  1)    /* y-size
  763.         SSP2( 22,240, 36,ysize,&H720,0)
  764.         try_c=stg_data((stage shl 9)+ 35)    /* try count
  765.         SSP2( 32,136, 76,try_c,&H720,0)
  766.         recd=stg_data((stage shl 9)+ 36) shl 24    /* record
  767.         recd=recd+(stg_data((stage shl 9)+ 37) shl 16)
  768.         recd=recd+(stg_data((stage shl 9)+ 38) shl 8)
  769.         recd=recd+ stg_data((stage shl 9)+ 39)
  770.         tim_w=recd / 60
  771.         SSP2( 40,216, 76,tim_w / 60,&H720,0)    /* min.
  772.         SSP2( 43,240, 76,tim_w mod 60,&H720,3)    /* sec.
  773.     } else {
  774. /*---- -: user mode status :- ----
  775.         xsize=user_data((stage shl 9)    )    /* x-size
  776.         SSP2( 20,208, 36,xsize,&H720,0)
  777.         ysize=user_data((stage shl 9)+  1)    /* y-size
  778.         SSP2( 22,240, 36,ysize,&H720,0)
  779.         try_c=0                    /* try count
  780.         recd=&H57E3F                /* record
  781.         SSP2( 32,136, 76, 0,&H720,0)
  782.         SSP2( 40,216, 76,99,&H720,0)        /* record min.
  783.         SSP2( 43,240, 76,59,&H720,3)        /* sec.
  784.     }
  785.  
  786.     tit_on=0
  787.     apage(0)
  788.     fill(272, 24,335, 87, 25)        /* picture clear
  789.     tfill( 16, 48, 79, 63, 0)
  790.     tfill(138, 40,245, 55, 0)        /* title clear
  791. endfunc
  792.  
  793. /*[G]= -: Problem Title :- ====
  794. /*====---------------------====
  795. func SEL_S2()
  796. /*---- -: ソノ モンダイヲ トイテイルカ? :- ----
  797.     if p_mode = 0 then {
  798.         wk0=stg_data((stage shl 9)+ 34)
  799.         if dbg = 1 then wk0=1
  800.     } else {
  801.         wk0=user_data((stage shl 9)+ 34)
  802.         if (wk0 and 2) = 2 then wk0=0 else wk0=1
  803.     }
  804.     sp_scrl(106,0,0,0,0)
  805.     sp_scrl(107,0,0,0,0)
  806.     sp_scrl(108,0,0,0,0)
  807.     sp_scrl(109,0,0,0,0)
  808.     sp_scrl(110,0,0,0,0)
  809.  
  810. /*---- -: マダ トイテイナイ :- ----
  811.     if (wk0 and 1) = 0 or xsize = 0 then {
  812.         sp_scrl(106, 40, 64,&H669,3)    /* "SP":sorry
  813.         sp_scrl(107, 48, 64,&H667,3)
  814.         sp_scrl(108, 56, 64,&H664,3)
  815.         sp_scrl(109, 64, 64,&H664,3)
  816.         sp_scrl(110, 72, 64,&H62F,3)
  817.         tit_on=&HFF
  818.         if xsize = 0 then tit_on=&HEF
  819.     } else {
  820.  
  821. /*---- -: トイテイル :- ----
  822.         if p_mode = 0 then {
  823.             for i=0 to 11        /* stage title
  824.                 wk0=stg_data((stage shl 9)+  2+i)
  825.                 TFP2((i shl 3)+i+138, 40,wk0)
  826.             next
  827.             for i=0 to 7        /* stage palet
  828.                 wk0=stg_data((stage shl 9)+ 18+(i shl 1))
  829.                 wk1=stg_data((stage shl 9)+ 19+(i shl 1))
  830.                 PL_S(12+i,(wk0 shl 8)+wk1)
  831.             next
  832.         } else {
  833.             for i=0 to 11        /* stage title
  834.                 wk0=user_data((stage shl 9)+  2+i)
  835.                 TFP2((i shl 3)+i+138, 40,wk0)
  836.             next
  837.             for i=0 to 7        /* stage palet
  838.                 wk0=user_data((stage shl 9)+ 18+(i shl 1))
  839.                 wk1=user_data((stage shl 9)+ 19+(i shl 1))
  840.                 PL_S(12+i,(wk0 shl 8)+wk1)
  841.             next
  842.         }
  843.  
  844.         tit_on=1
  845.         pic_x=0
  846.         pic_y=0
  847.         dsp_x=304-xsize
  848.         dsp_y=56-ysize
  849.     }
  850. endfunc
  851.  
  852. /*==== -: Problem Picture :- ====
  853. /*====-----------------------====
  854. func SEL_S3()
  855.     if p_mode = 0 then {
  856.         for i=0 to 14
  857.             wk0=stg_data((stage shl 9)+ 62+pic_y*15+i)
  858.             wk0=wk0 and &HEE
  859. /*            wk0=wk0 xor &H11    /* bit off => ハントウメイニ
  860.             wk9((i shl 2)  )=24+(wk0 shr 4)
  861.             wk9((i shl 2)+1)=24+(wk0 shr 4)
  862.             wk9((i shl 2)+2)=24+(wk0 and 15)
  863.             wk9((i shl 2)+3)=24+(wk0 and 15)
  864.         next
  865.     } else {
  866.         for i=0 to 14
  867.             wk0=user_data((stage shl 9)+ 62+pic_y*15+i)
  868.             wk0=wk0 and &HEE
  869. /*            wk0=wk0 xor &H11    /* bit off => ハントウメイニ
  870.             wk9((i shl 2)  )=24+(wk0 shr 4)
  871.             wk9((i shl 2)+1)=24+(wk0 shr 4)
  872.             wk9((i shl 2)+2)=24+(wk0 and 15)
  873.             wk9((i shl 2)+3)=24+(wk0 and 15)
  874.         next
  875.     }
  876.  
  877.     put(dsp_x,dsp_y+(pic_y shl 1),dsp_x+(xsize shl 1)-1,dsp_y+(pic_y shl 1),wk9)
  878.     put(dsp_x,dsp_y+(pic_y shl 1)+1,dsp_x+(xsize shl 1)-1,dsp_y+(pic_y shl 1)+1,wk9)
  879.     pic_y=pic_y+1
  880.     if pic_y = ysize then tit_on=&HFF
  881.     if piko(0) <> 3 then piko(0)=piko(0)+1
  882. endfunc
  883.  
  884. /*[G]= -: Game Initialize :- ====
  885. /*====-----------------------====
  886. /* use sp.plane : 80 > モンダイ
  887. /*        : 81 > ジカン
  888. /*        : 84-86 > prob. no.
  889. /*        : 87 > ":"
  890. /*        : 88-91 > time
  891. func G_INIT()
  892.     home(0,  0,  0) : home(1,  0,  0)
  893.  
  894. /*---- -: Screen Make :- ----
  895.     apage(1)
  896.     fill(  8,  8, 39, 39,  4)        /* sample clear
  897.     apage(0)
  898.     fill(  6,  6, 69, 69,177)        /* ジカン ナドヲ ヒョウジスル ワク
  899.     fill(  4,  4, 67, 67, 62)
  900.     for i=0 to 7
  901.         wk0=(i shl 3)
  902.         put(  4,wk0+ 4, 11,wk0+11,REPT4)
  903.         put( 60,wk0+ 4, 67,wk0+11,REPT5)
  904.         put(wk0+ 4,  4,wk0+11, 11,REPT6)
  905.         put(wk0+ 4, 60,wk0+11, 67,REPT7)
  906.     next
  907.     put(  4,  4, 11, 11,REPT0)
  908.     put(  4, 60, 11, 67,REPT1)
  909.     put( 60,  4, 67, 11,REPT2)
  910.     put( 60, 60, 67, 67,REPT3)
  911.     put(  8, 48, 63, 63,HLPM)
  912.  
  913.     if p_mode = 0 then {
  914.         if (stg_data((stage shl 9)+ 34) and 1) = 1 then {
  915.             tput(  0,  0,16,16,FLW,"pset")
  916.         }
  917.     }
  918.     if svld = 0 or p_mode = 1 then {
  919.         tim_c=0
  920.         help_p=20
  921.     }
  922.     GI_S1()
  923.  
  924. /*---- -: Stage Data Making :- ----
  925.     if p_mode = 0 then {
  926.         xsize=stg_data((stage shl 9)    )    /* x-size
  927.         ysize=stg_data((stage shl 9)+  1)    /* y-size
  928.         for i=0 to 15                /* stage title
  929.             stg_name(i)=stg_data((stage shl 9)+  2+i)
  930.         next
  931.  
  932.         for i=0 to 7                /* stage palet
  933.             wk0=stg_data((stage shl 9)+ 18+(i shl 1))
  934.             wk1=stg_data((stage shl 9)+ 19+(i shl 1))
  935.  
  936.             edit_palet(i)=(wk0 shl 8)+wk1
  937.             PL_S(12+i,(wk0 shl 8)+wk1)
  938.         next
  939.  
  940.         for i=0 to 449                /* stage data
  941.             wk0=stg_data((stage shl 9)+ 62+i)
  942.  
  943.             edit_map((i shl 1)  )=wk0 shr 4
  944.             edit_map((i shl 1)+1)=wk0 and 15
  945.         next
  946.     } else {
  947.         xsize=user_data((stage shl 9)    )    /* x-size
  948.         ysize=user_data((stage shl 9)+  1)    /* y-size
  949.         for i=0 to 15                /* stage title
  950.             stg_name(i)=user_data((stage shl 9)+  2+i)
  951.         next
  952.  
  953.         for i=0 to 7                /* stage palet
  954.             wk0=user_data((stage shl 9)+ 18+(i shl 1))
  955.             wk1=user_data((stage shl 9)+ 19+(i shl 1))
  956.  
  957.             edit_palet(i)=(wk0 shl 8)+wk1
  958.             PL_S(12+i,(wk0 shl 8)+wk1)
  959.         next
  960.  
  961.         for i=0 to 449                /* stage data
  962.             wk0=user_data((stage shl 9)+ 62+i)
  963.  
  964.             edit_map((i shl 1)  )=wk0 shr 4
  965.             edit_map((i shl 1)+1)=wk0 and 15
  966.         next
  967.     }
  968.  
  969.     if svld = 0 or p_mode = 1 then {
  970.         for i=0 to 899                /* flag data clear
  971.             flg_map(i)=0
  972.         next
  973.  
  974.         stg_cmp=0                /* stg_cmp ショキチ ケイサン
  975.         for i=0 to 899
  976.             if (edit_map(i) and 1) = 0 then stg_cmp=stg_cmp+1
  977.         next
  978.     }
  979.  
  980. /*---- -: Hint Data Display :- ----
  981.     if svld = 0 or p_mode = 1 then HINT_CHECK()
  982.     EDIT_DIS()
  983.     KEISEN()
  984. endfunc
  985. func GI_S1()
  986.     sp_scrl( 80, 24, 26,&H248,3-(inft*3))    /* "SP":モンダイ
  987.     if inft = 0 then {
  988.         apage(0)
  989.         fill(  8,  8, 39, 39, 62)    /* ツウジョウ ニ モドス
  990.         SSP3( 84, 52, 26,stage+1,&H230,0)    /* モンダイバンゴウ
  991.         tfill( 56, 16, 63, 47, 0)
  992.     } else {
  993.         apage(0)
  994.         fill(  8,  8, 39, 39, 64)    /* ジョウタイミホン ノ ワク
  995.         fill(  9,  9, 38, 38,  0)
  996.         sp_scrl(84,0,0,0,0)        /* モンダイバンゴウ ヲ ケス
  997.         sp_scrl(85,0,0,0,0)
  998.         sp_scrl(86,0,0,0,0)
  999.         TFP( 56, 18,"j")        /* (M)in,(S)ec
  1000.         TFP( 56, 36,"k")
  1001.     }
  1002.     sp_scrl( 81, 24, 44,&H24A,3-(inft*3))    /* "SP":ジカン
  1003.     sp_scrl( 87, 56, 44,&H24F,3-(inft*3))    /* "SP":':'
  1004.  
  1005.     TIM_P1()                /* ケイカジカン ヒョウジ
  1006.     HELP_DIS()                /* ヘルプ ヒョウジ
  1007. endfunc
  1008.  
  1009. /*[G]= -: Game Start :- ====
  1010. /*====------------------====
  1011. func GAME_ST()
  1012.     char min,sec
  1013.     tim_w=recd / 60
  1014.     min=tim_w / 60
  1015.     sec=tim_w mod 60
  1016.     sp_col2( 1,0, 0)            /* ヒント ヲ ケス
  1017.     sp_col2( 2,0, 0)
  1018.     sp_col2( 4,0, 0)
  1019.     sp_col2( 5,0, 0)
  1020.     sp_out()
  1021.  
  1022.     vpage(3) : sp_disp(1) : TX_DISP(1)
  1023.     play_zmd(15+bgm_no)            /* play "game bgm"
  1024.  
  1025.     for i=0 to 5 : v_disp() : next
  1026.     for i=0 to 8
  1027.         wk0=16-(i shl 1)
  1028.         wk1=32-(i shl 2)
  1029.         sp_scrl(  0,116-wk1,136,&H369,3)    /* "SP":start!
  1030.         sp_scrl(  1,124-wk0,136,&H36A,3)
  1031.         sp_scrl(  2,132-(8-i),136,&H363,3)
  1032.         sp_scrl(  3,140+(8-i),136,&H364,3)
  1033.         sp_scrl(  4,148+wk0,136,&H36A,3)
  1034.         sp_scrl(  5,156+wk1,136,&H33E,3)
  1035.  
  1036.         sp_scrl(  6,112-wk1,136,&H869,3)
  1037.         sp_scrl(  7,122-wk0,136,&H86A,3)
  1038.         sp_scrl(  8,131-(8-i),136,&H863,3)
  1039.         sp_scrl(  9,141+(8-i),136,&H864,3)
  1040.         sp_scrl( 10,150+wk0,136,&H86A,3)
  1041.         sp_scrl( 11,160+wk1,136,&H83E,3)
  1042.  
  1043.         sp_scrl( 12, 16, 88,&H56A,3)        /* "SP":try
  1044.         sp_scrl( 13, 16+i, 88,&H564,3)
  1045.         sp_scrl( 14, 16+(i shl 1), 88,&H52F,3)
  1046.         SSP2( 15, 16+(i shl 2), 88,try_c,&H720,3)
  1047.         sp_scrl( 17, 16,104,&H564,3)        /* "SP":record
  1048.         sp_scrl( 18, 16+i,104,&H562,3)
  1049.         sp_scrl( 19, 16+(i shl 1),104,&H560,3)
  1050.         sp_scrl( 20, 16+i*3,104,&H567,3)
  1051.         sp_scrl( 21, 16+(i shl 2),104,&H564,3)
  1052.         sp_scrl( 22, 16+i*5,104,&H52D,3)
  1053.         sp_scrl( 25, 16+i*9,104,&H557,3)
  1054.         SSP2( 23, 16+i*7,104,min,&H720,0)
  1055.         SSP2( 26, 16+i*10,104,sec,&H720,3)
  1056.         sp_out()
  1057.     next
  1058.     sp_scrl(6,0,0,0,0)
  1059.     sp_scrl(7,0,0,0,0)
  1060.     sp_scrl(8,0,0,0,0)
  1061.     sp_scrl(9,0,0,0,0)
  1062.     sp_scrl(10,0,0,0,0)
  1063.     sp_scrl(11,0,0,0,0)
  1064.     sp_out()
  1065.  
  1066.     PRS_BT( 28,240,240)            /* press button
  1067.  
  1068.     sp_palet( 0,PAL, 0)
  1069.     for i=0 to 27
  1070.         sp_scrl(i,0,0,0,0)
  1071.     next
  1072.     sp_out()
  1073. endfunc
  1074.  
  1075. /*[E]= -: Editor :- ====
  1076. /*====--------------====
  1077. func EDITOR()
  1078.     home(0,  0,  0) : home(1,  0,  0)
  1079.  
  1080. /*---- -: Edit Data Init. :- ----
  1081.     pen_mode=0
  1082.     pen_c=0
  1083.     stage=0
  1084.     EDIT_ALL_INIT(0)
  1085.  
  1086. /*---- -: Screen Make :- ----
  1087.     apage(1)                /* active "1" make.
  1088.     for i=0 to 7                /* back 2
  1089.         wk0=(i shl 5)+256
  1090.         for j=0 to 7
  1091.             wk1=(j shl 5)
  1092.             put(wk1   ,wk0   ,wk1+15,wk0+15,BK2)
  1093.             put(wk1   ,wk0+16,wk1+15,wk0+31,BK2_)
  1094.             put(wk1+16,wk0   ,wk1+31,wk0+15,BK2_)
  1095.             put(wk1+16,wk0+16,wk1+31,wk0+31,BK2)
  1096.         next
  1097.     next
  1098.     apage(0)                /* active "0" make.
  1099. /*    fill(  4,  4, 69, 67,  0)        /* sample clear
  1100.     box(  4,  4, 35, 35,  6,&H5555)        /* "bit" smp.
  1101.     box( 38,  4, 69, 35,  6,&H5555)        /* "pic" smp.
  1102.     fill(  6, 38, 69, 69,177)        /* para. win.
  1103.     for i=0 to 3
  1104.         put(  4+(i shl 4), 36, 19+(i shl 4), 51,BK0)
  1105.         put(  4+(i shl 4), 52, 19+(i shl 4), 67,BK0)
  1106.     next
  1107.     EDIT_DIS()
  1108.     KEISEN()
  1109.     tfill(  4, 36, 67, 67, 8)        /* para. win. ワク
  1110.     tfill(  5, 37, 66, 66,15)
  1111.     tfill(  6, 38, 65, 65, 8)
  1112.     tfill(  7, 39, 64, 64, 0)
  1113.     TFP(  8, 40,"X\01a")            /* x ザヒョウ
  1114.     TSP( 48, 40,xsize)
  1115.     TFP(  8, 48,"Y\01a")            /* y ザヒョウ
  1116.     TSP( 48, 48,ysize)
  1117.     TFP(  8, 56,"de")            /* active color
  1118.     apage(0)
  1119.     fill( 25, 57, 31, 63, 16)
  1120.     fill( 24, 56, 30, 62, 24+(pen_c shl 1))
  1121.     TFP( 32, 56,"fg")            /* pen mode
  1122.     TFP( 48, 56,"BT")
  1123.     apage(1)
  1124.     get( 73, 73,102,102,wkA)
  1125.     play_zmd(23)
  1126.  
  1127.     PX_MAIN()
  1128.  
  1129.     SCR_ALL_OFF()
  1130. endfunc
  1131.  
  1132. /*==== -: Rule :- ====
  1133. /*====------------====
  1134. func RULE()
  1135. /*---- -: Screen Make :- ----
  1136.     stage=0
  1137.     G_INIT()
  1138.     BK_PAL_SET()
  1139.     sp_scrl( 24, 24,204,&H145,3)        /* "SP":ピクチャークロスワード
  1140.     sp_scrl( 25, 40,204,&H149,3)
  1141.     sp_scrl( 26, 56,204,&H14B,3)
  1142.     for i=0 to 3                /* "SP":PX logo
  1143.         sp_scrl( 34+i, 16+(i shl 4),224,&H370+i,3)
  1144.         sp_scrl( 38+i, 16+(i shl 4),240,&H374+i,3)
  1145.         sp_scrl( 42+i, 20+(i shl 4),228,&H470+i,3)
  1146.         sp_scrl( 46+i, 20+(i shl 4),244,&H474+i,3)
  1147.         sp_scrl( 50+i, 12+(i shl 4),220,&H570+i,3)
  1148.         sp_scrl( 54+i, 12+(i shl 4),236,&H574+i,3)
  1149.     next
  1150.     sp_out()
  1151.  
  1152. /*---- -: text put :- ----
  1153.     apage(0)
  1154.     for i=0 to 4
  1155.         fill(120+i,  0,255,255,193-(i shl 2))
  1156.     next
  1157.     line(120,0,120,255,197,&HAAAA)
  1158.     line(121,0,121,255,193,&H5555)
  1159.     line(122,0,122,255,189,&HAAAA)
  1160.     line(123,0,123,255,185,&H5555)
  1161.     for i=0 to 127
  1162.         line(124,(i shl 1)  ,255,(i shl 1)  ,181,&HAAAA)
  1163.         line(124,(i shl 1)+1,255,(i shl 1)+1,181,&H5555)
  1164.     next
  1165.     for i=0 to 63
  1166.         get(376,256+(i shl 2),511,259+(i shl 2),wkA)
  1167.         tput(120,i shl 2,136,4,wkA,"pset")
  1168.     next
  1169.     for i=0 to 17
  1170.         line(  0,191+i, 64-i,255,rb_p(i))
  1171.     next
  1172.  
  1173.     tim_c=0
  1174.     vpage(3) : sp_disp(1) : TX_DISP(1)
  1175.     play_zmd(12)                /* play "rule bgm"
  1176.     contrast(15)
  1177.  
  1178.     kb_cls()
  1179.     bton=kstrig(1)
  1180.     while tim_c <> 900
  1181.         if g_mode = 3 then tim_c=tim_c+1
  1182.         ST_INP()
  1183.  
  1184.         if kyb = &H1B then break    /* ret. to title
  1185. /*---- -: push anime :- ----
  1186.         piko(0)=piko(0)+1 and 15
  1187.         if piko(0) = 0 then {
  1188.             piko(1)=piko(1)+1 and 1
  1189.             sp_scrl(  0,256,244+(piko(1) shl 1),&H16F,3)
  1190.             sp_scrl(  1,256,256,&H16D+piko(1),3)
  1191.         }
  1192.  
  1193. /*++++ -: ボタン ガ オサレタトキ :- ++++
  1194.         if bton = 0 and BT1 <> 0 then {
  1195.             play_se(3)
  1196.             break
  1197.         }
  1198.  
  1199.         if bton <> BT1 then bton=0
  1200.  
  1201.         sp_out()
  1202.     endwhile
  1203.  
  1204.     m_fadeout(40)
  1205.     SCR_ALL_OFF()
  1206. endfunc
  1207. func RULE_S1(y;int,tm;char,hd;int)
  1208.     for i=0 to tm
  1209.         wk0=R_TXT(hd+i) shr 1
  1210.         wk1=R_TXT(hd+i) and 1
  1211.         wk2=380+(i shl 3)
  1212.  
  1213.         sp_pcg(&H3F,PCG1,&H98+wk0)
  1214.         sp_out()
  1215.  
  1216.         sp_pat(&HFC+(wk1 shl 1),wk9,0)
  1217.         put(wk2,y   ,wk2+7,y+ 7,wk9)
  1218.         sp_pat(&HFD+(wk1 shl 1),wk9,0)
  1219.         put(wk2,y+ 8,wk2+7,y+15,wk9)
  1220.     next
  1221. endfunc
  1222.  
  1223. /*==== -: PX Main :- ====
  1224. /*====---------------====
  1225. /* use sp.plane : 100 > トンカチ
  1226. /*        : 101 > クイ
  1227. /*        : 104,5,6,7 > spark
  1228. /*        : 108-115 > crush
  1229. /*        : 116,7,8 > cursole(m,x,y)
  1230. func PX_MAIN()
  1231.     cx=0 : cx_=cx*6
  1232.     cy=0 : cy_=cy*6
  1233.     if g_mode = 0 then {
  1234.         X_LC1()
  1235.         Y_LC1()
  1236.     }
  1237.     sp_scrl(101,cx_+ 88,cy_+ 80,&H150+pen_mode,3)    /* "SP":pick
  1238.     sp_scrl(116,cx_+ 84,cy_+ 84,&H140,3)        /* "SP":cs(m)
  1239.     sp_out()
  1240.  
  1241.     vpage(3) : sp_disp(1) : TX_DISP(1)
  1242.  
  1243. /*---- -: "PX" Game/Edit Main :- ----
  1244.     kb_cls()
  1245.     ston=&HFF
  1246.     sths=&HFF
  1247.     bton=kstrig(1)
  1248.     while 1
  1249.         ST_INP()
  1250.  
  1251.         if kyb = &H1B then break    /* ret. to title
  1252.  
  1253. /*---- -: カーソル カラー グラデーション :- ----
  1254.         cs_grd=cs_grd+1 and 31
  1255.         if (cs_grd and 3) = 3 then {
  1256.             sp_col2( 6,(30-(cs_grd shr 2)) shl 6, 1)
  1257.         }
  1258.  
  1259. /*---- -: ケイカジカン ケイソク :- ----
  1260.         if g_mode = 0 then {
  1261.             tim_c=tim_c+1
  1262.             if tim_c >= &H57E3F then g_mode=99
  1263.             TIM_P1()
  1264.         }
  1265.  
  1266. /*++++ -: カーソル イドウ :- ++++
  1267.         cxn=cx
  1268.         cyn=cy
  1269.  
  1270.         if ston = 0 then {
  1271.         if ST1 <> 0 and sths = ST1 then {
  1272.             cx=cx+mvof(ST1)
  1273.             if cx = &HFF then {    /* ハミデタラ ヒントチェック ヘ
  1274.                 if g_mode = 0 then XHNT_MK()
  1275.                 cx=0
  1276.             }
  1277.             if cx = xsize then cx=xsize-1
  1278.             cy=cy+mvof(ST1+10)
  1279.             if cy = &HFF then {    /* ハミデタラ ヒントチェック ヘ
  1280.                 if g_mode = 0 then YHNT_MK()
  1281.                 cy=0
  1282.             }
  1283.             if cy = ysize then cy=ysize-1
  1284.  
  1285.             cx_=cx*6
  1286.             cy_=cy*6
  1287.  
  1288.             if cx <> cxn or cy <> cyn then {
  1289.                 play_se(1)
  1290.                 sp_scrl(101,cx_+ 88,cy_+ 80,&H150+pen_mode,3)    /* "SP":pick
  1291.                 sp_scrl(116,cx_+ 84,cy_+ 84,&H140,3)        /* "SP":cs(m)
  1292.                 if g_mode = 0 then {
  1293.                     if cx <> cxn then X_LC1()
  1294.                     if cy <> cyn then Y_LC1()
  1295.                     tim_c=tim_c+1
  1296.                 }
  1297.                 if g_mode = 1 then {
  1298.                     TSP( 24, 40,cx+1)
  1299.                     TSP( 24, 48,cy+1)
  1300.                 }
  1301.                 if BT1 <> 0 then bton=0
  1302.             }
  1303.         }
  1304.         }
  1305.  
  1306.         if bton = 0 then {
  1307. /*++++ -: "A" or "B" ボタン ガ オサレタトキ :- ++++
  1308.             if BT1 = 1 or BT1 = 2 then {
  1309.                 if g_mode = 0 then {
  1310.                     NML_BLK_P(0)
  1311.                     sp_scrl(104,0,0,0,0)    /* "SP":spark
  1312.                     sp_scrl(105,0,0,0,0)
  1313.                 }
  1314.                 if g_mode = 1 then {
  1315.                     if pen_mode = 0 then CLBK_BIT()
  1316.                     if pen_mode = 1 then CLBK_PIC()
  1317.                 }
  1318.                 bton=BT1
  1319.             }
  1320.  
  1321. /*++++ -: ボタン ガ ドウジニ オサレタバアイ :- ++++
  1322.             if BT1 = 3 or kyb = &H20 or kyb = &H0D then {
  1323.                 play_se(7)
  1324.                 if g_mode = 0 then HELP(0)
  1325.                 if g_mode = 1 then TOOLS()
  1326.                 bton=BT1
  1327.             }
  1328.         }
  1329.  
  1330. /*---- -: イロイロ ハンテイ :- ----
  1331.         if g_mode = 0 and dbg = 1 then {
  1332.             if kyb = &H47 or kyb = &H67 then g_mode=99    /* "G":キョウセイ ゲーム オーバー
  1333.             if kyb = &H43 or kyb = &H63 then stg_cmp=900    /* "C":キョウセイ クリア!
  1334.         }
  1335.         if g_mode = 1 then {
  1336.             if kyb = &H50 or kyb = &H70 then {    /* "P":pen mode change
  1337.                 play_se(1)
  1338.                 pen_mode=pen_mode+1 and 1
  1339.                 if pen_mode = 0 then {
  1340.                     TFP( 48, 56,"BT")
  1341.                 } else {
  1342.                     TFP( 48, 56,"PC")
  1343.                 }
  1344.                 sp_scrl(101,cx_+ 88,cy_+ 80,&H150+pen_mode,3)    /* "SP":pick
  1345.             }
  1346.         }
  1347.         if g_mode = 0 and stg_cmp = 900 then break    /* クリア!
  1348.         if g_mode = 99 then break    /* ゲーム オーバー
  1349.         if kyb = &H1B then break    /* return to title
  1350.  
  1351. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  1352.         ST_CK2(16,1)
  1353.  
  1354. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  1355.         if bton <> BT1 then {
  1356.             bton=0
  1357.             flg_on_mode=0
  1358.             if g_mode = 0 then {
  1359.                 sp_scrl(100,0,0,0,0)            /* "SP":トンカチ
  1360.                 sp_scrl(101,cx_+ 88,cy_+ 80,&H150,3)    /* "SP":pick'
  1361.             }
  1362.         }
  1363.  
  1364.         sp_out()
  1365.     endwhile
  1366.  
  1367.     if kyb <> &H1B and p_mode = 0 then {
  1368.     if g_mode = 0 or g_mode = 99 then {
  1369. /*---- -: ナンカイメ ノ プレイ :- ----
  1370.         if try_c <= 98 then try_c=try_c+1
  1371.         stg_data((stage shl 9)+ 35)=try_c
  1372.  
  1373.         if p_mode = 0 and dbg = 0 and dskok = 1 then {    /* save
  1374.             wk0=fopen(stg_fl+".DAT","w")
  1375. /*            fwrite(stg_data,51200,wk0)
  1376.             fseek(wk0,(stage shl 9)+ 35,0)
  1377.             fputc(try_c,wk0)
  1378.             fclose(wk0)
  1379.         }
  1380.     }
  1381.     }
  1382. endfunc
  1383.  
  1384. /*[G]= -: Line Cursole :- ====
  1385. /*====--------------------====
  1386. func X_LC1()
  1387.     apage(0)
  1388.     fill(cxn*6+ 73,  3,cxn*6+ 78, 68,  0)    /* line cuesole
  1389.     fill(cx_  + 73,  3,cx_  + 78, 68, 19)
  1390.     sp_scrl(117,cx_+ 84, 79,&H142,3)    /* "SP":cs(y)
  1391. endfunc
  1392. func Y_LC1()
  1393.     apage(0)
  1394.     fill(  3,cyn*6+ 73, 68,cyn*6+ 78,  0)    /* line cursole
  1395.     fill(  3,cy_  + 73, 68,cy_  + 78, 19)
  1396.     sp_scrl(118, 79,cy_+ 84,&H143,3)    /* "SP":cs(x)
  1397. endfunc
  1398.  
  1399. /*[G]= -: X-Line Hint Marking :- ====
  1400. /*====---------------------------====
  1401. func XHNT_MK()
  1402. /*---- -: カーソル ナドヲ ショウキョ :- ----
  1403.     sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  1404.     sp_scrl(101,0,0,0,0)            /* "SP":pick
  1405.     sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  1406.     sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  1407. /*    sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  1408.     apage(0)
  1409.     fill( 73,  3,252, 68,  0)        /* line cursole clear
  1410.     fill(  3, 73, 68,252,  0)
  1411.  
  1412.     px=10
  1413.     cx_=px*6
  1414.     py=cy
  1415.     cy_=py*6
  1416.     fill( 73,cy_+ 73,xsize*6+ 72,cy_+ 77, 19)    /* line cursole
  1417.     sp_scrl(101,cx_+ 20,cy_+ 78,&H141,3)    /* "SP":pencil
  1418.     sp_scrl(118,     79,cy_+ 84,&H143,3)    /* "SP":cs(x)
  1419.     sp_out()
  1420.     play_se(1)
  1421.  
  1422. /*---- -: ヨコ ノ ヒント マーキング メイン :- ----
  1423.     kb_cls()
  1424.     ston=&HFF
  1425. /*    sths=&HFF
  1426.     bton=kstrig(1)
  1427.     while 1
  1428.         ST_INP()
  1429.  
  1430.         if kyb = &H1B then break    /* ret. to title
  1431.  
  1432. /*---- -: カーソル カラー グラデーション :- ----
  1433.         cs_grd=cs_grd+1 and 31
  1434.         if (cs_grd and 3) = 3 then {
  1435.             sp_col2( 6,(30-(cs_grd shr 2)) shl 6, 1)
  1436.         }
  1437.  
  1438. /*---- -: ケイカジカン ケイソク :- ----
  1439.         tim_c=tim_c+1
  1440.         if tim_c >= &H57E3F then {
  1441.             g_mode=99
  1442.             break
  1443.         }
  1444.         TIM_P1()
  1445.  
  1446. /*++++ -: カーソル イドウ :- ++++
  1447.         cxn=px
  1448.         cyn=py
  1449.  
  1450.         if ston = 0 then {
  1451.         if ST1 <> 0 and sths = ST1 then {
  1452.             px=px+mvof(ST1)
  1453.             if px = &HFF then px=0
  1454.             if px = 11 then break        /* ハミデタラ モドル
  1455.             py=py+mvof(ST1+10)
  1456.             if py = &HFF then py=0
  1457.             if py = ysize then py=ysize-1
  1458.  
  1459.             cx_=px*6
  1460.             cy_=py*6
  1461.  
  1462.             if px <> cxn or py <> cyn then {
  1463.                 play_se(1)
  1464.                 apage(0)
  1465.                 fill( 73,cyn*6+ 73,        252,cyn*6+ 77,  0)
  1466.                 fill( 73,cy_  + 73,xsize*6+ 72,cy_  + 77, 19)
  1467.                 sp_scrl(101,cx_+ 20,cy_+ 78,&H141,3)    /* "SP":pencil
  1468.                 sp_scrl(118,     79,cy_+ 84,&H143,3)    /* "SP":cs(x)
  1469.  
  1470.                 if BT1 <> 0 then bton=0
  1471.                 tim_c=tim_c+1
  1472.             }
  1473.         }
  1474.         }
  1475.  
  1476.         if bton = 0 then {
  1477. /*++++ -: "A" ボタン ガ オサレタトキ :- ++++
  1478.         if BT1 = 1 then {
  1479.             wk0=hint_x(py*11+(10-px))
  1480.             if wk0 <> &HFF then {
  1481.                 if (wk0 and &H80) = 0 then {
  1482.                     if flg_on_mode = 0 or flg_on_mode = 1 then {
  1483.                         play_se(5)
  1484.                         sp_pat(&H20+(wk0 and 127),wk9,0)
  1485.                         tput(cx_+  3,cy_+ 73,6,6,wk9,"pset")
  1486.                         flg_on_mode=1
  1487.                         hint_x(py*11+(10-px))=wk0 xor &H80
  1488.                     }
  1489.                 } else {
  1490.                     if flg_on_mode = 0 or flg_on_mode = 2 then {
  1491.                         play_se(5)
  1492.                         sp_pat(&H00+(wk0 and 127),wk9,0)
  1493.                         tput(cx_+  3,cy_+ 73,6,6,wk9,"pset")
  1494.                         flg_on_mode=2
  1495.                         hint_x(py*11+(10-px))=wk0 xor &H80
  1496.                     }
  1497.                 }
  1498.             }
  1499.             bton=BT1
  1500.         }
  1501.         if BT1 = 3 or kyb = &H20 or kyb = &H0D then {
  1502.             play_se(7)
  1503.             HELP(1)
  1504.             bton=BT1
  1505.         }
  1506.         }
  1507.  
  1508. /*---- -: イロイロ ハンテイ :- ----
  1509.         if dbg = 1 then {
  1510.             if kyb = &H47 or kyb = &H67 then g_mode=99    /* "G":キョウセイ ゲーム オーバー
  1511.             if kyb = &H43 or kyb = &H63 then stg_cmp=900    /* "C":キョウセイ クリア!
  1512.         }
  1513.         if g_mode = 0 and stg_cmp = 900 then break    /* クリア!
  1514.         if g_mode = 99 then break    /* ゲーム オーバー
  1515.         if kyb = &H1B then break    /* ret. to title
  1516.  
  1517. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  1518.         ST_CK2(16,1)
  1519.  
  1520. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  1521.         if bton <> BT1 then {
  1522.             bton=0
  1523.             flg_on_mode=0
  1524.         }
  1525.  
  1526.         sp_out()
  1527.     endwhile
  1528.  
  1529.     cy=py
  1530.     apage(0)
  1531.     fill( 73,cy_+ 73,252,cy_+ 78,  0)
  1532.     if kyb = &H1B or g_mode = 99 or stg_cmp = 900 then return()
  1533.     Y_LC1()
  1534.     sp_out()
  1535. endfunc
  1536.  
  1537. /*[G]= -: Y-Line Hint Marking :- ====
  1538. /*====---------------------------====
  1539. func YHNT_MK()
  1540. /*---- -: カーソル ナドヲ ショウキョ :- ----
  1541.     sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  1542.     sp_scrl(101,0,0,0,0)            /* "SP":pick
  1543.     sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  1544. /*    sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  1545.     sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  1546.     apage(0)
  1547.     fill( 73,  3,252, 68,  0)        /* line cursole clear
  1548.     fill(  3, 73, 68,252,  0)
  1549.  
  1550.     px=cx
  1551.     cx_=px*6
  1552.     py=10
  1553.     cy_=py*6
  1554.     fill(cx_+ 73, 73,cx_+ 77,ysize*6+ 72, 19)    /* line cursole
  1555.     sp_scrl(101,cx_+ 90,cy_+  8,&H141,3)    /* "SP":pencil
  1556.     sp_scrl(117,cx_+ 84,     79,&H142,3)    /* "SP":cs(y)
  1557.     sp_out()
  1558.     play_se(1)
  1559.  
  1560. /*---- -: タテ ノ ヒント マーキング メイン :- ----
  1561.     ston=&HFF
  1562. /*    sths=&HFF
  1563.     bton=kstrig(1)
  1564.     while 1
  1565.         ST_INP()
  1566.  
  1567.         if kyb = &H1B then break    /* return to title
  1568.  
  1569. /*---- -: カーソル カラー グラデーション :- ----
  1570.         cs_grd=cs_grd+1 and 31
  1571.         if (cs_grd and 3) = 3 then {
  1572.             sp_col2( 6,(30-(cs_grd shr 2)) shl 6, 1)
  1573.         }
  1574.  
  1575. /*---- -: ケイカジカン ケイソク :- ----
  1576.         tim_c=tim_c+1
  1577.         if tim_c >= &H57E3F then {
  1578.             g_mode=99
  1579.             break
  1580.         }
  1581.         TIM_P1()
  1582.  
  1583. /*++++ -: カーソル イドウ :- ++++
  1584.         cxn=px
  1585.         cyn=py
  1586.  
  1587.         if ston = 0 then {
  1588.         if ST1 <> 0 and sths = ST1 then {
  1589.             px=px+mvof(ST1)
  1590.             py=py+mvof(ST1+10)
  1591.             if px = &HFF then px=0
  1592.             if px = xsize then px=xsize-1
  1593.             if py = &HFF then py=0
  1594.             if py = 11 then break        /* ハミデタラ モドル
  1595.  
  1596.             cx_=px*6
  1597.             cy_=py*6
  1598.  
  1599.             if px <> cxn or py <> cyn then {
  1600.                 play_se(1)
  1601.                 apage(0)
  1602.                 fill(cxn*6+ 73, 73,cxn*6+ 77,        252,  0)
  1603.                 fill(cx_  + 73, 73,cx_  + 77,ysize*6+ 72, 19)
  1604.                 sp_scrl(101,cx_+ 90,cy_+  8,&H141,3)    /* "SP":pencil
  1605.                 sp_scrl(117,cx_+ 84,     79,&H142,3)    /* "SP":cs(y)
  1606.  
  1607.                 if BT1 <> 0 then bton=0
  1608.                 tim_c=tim_c+1
  1609.             }
  1610.         }
  1611.         }
  1612.  
  1613.         if bton = 0 then {
  1614. /*++++ -: "A" ボタン ガ オサレタトキ :- ++++
  1615.         if BT1 = 1 then {
  1616.             wk0=hint_y(px*11+(10-py))
  1617.             if wk0 <> &HFF then {
  1618.                 if (wk0 shr 7) = 0 then {
  1619.                     if flg_on_mode = 0 or flg_on_mode = 1 then {
  1620.                         play_se(5)
  1621.                         sp_pat(&H20+(wk0 and 127),wk9,0)
  1622.                         tput(cx_+ 73,cy_+  3,6,6,wk9,"pset")
  1623.                         flg_on_mode=1
  1624.                         hint_y(px*11+(10-py))=wk0 xor &H80
  1625.                     }
  1626.                 } else {
  1627.                     if flg_on_mode = 0 or flg_on_mode = 2 then {
  1628.                         play_se(5)
  1629.                         sp_pat(&H00+(wk0 and 127),wk9,0)
  1630.                         tput(cx_+ 73,cy_+  3,6,6,wk9,"pset")
  1631.                         flg_on_mode=2
  1632.                         hint_y(px*11+(10-py))=wk0 xor &H80
  1633.                     }
  1634.                 }
  1635.             }
  1636.             bton=BT1
  1637.         }
  1638.         if BT1 = 3 or kyb = &H20 or kyb = &H0D then {
  1639.             play_se(7)
  1640.             HELP(2)
  1641.             bton=BT1
  1642.         }
  1643.         }
  1644.  
  1645. /*---- -: イロイロ ハンテイ :- ----
  1646.         if dbg = 1 then {
  1647.             if kyb = &H47 or kyb = &H67 then g_mode=99    /* "G":キョウセイ ゲーム オーバー
  1648.             if kyb = &H43 or kyb = &H63 then stg_cmp=900    /* "C":キョウセイ クリア!
  1649.         }
  1650.         if g_mode = 0 and stg_cmp = 900 then break    /* クリア!
  1651.         if g_mode = 99 then break    /* ゲーム オーバー
  1652.         if kyb = &H1B then break    /* ret. to title
  1653.  
  1654. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  1655.         ST_CK2(16,1)
  1656.  
  1657. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  1658.         if bton <> BT1 then {
  1659.             bton=0
  1660.             flg_on_mode=0
  1661.         }
  1662.  
  1663.         sp_out()
  1664.     endwhile
  1665.  
  1666.     cx=px
  1667.     apage(0)
  1668.     fill(cx_+ 73, 73,cx_+ 78,252,  0)
  1669.     if kyb = &H1B or g_mode = 99 or stg_cmp = 900 then return()
  1670.     X_LC1()
  1671.     sp_out()
  1672. endfunc
  1673.  
  1674. /*[G]= -: Help Point Display :- ====
  1675. /*====--------------------------====
  1676. func HELP_DIS()
  1677.     wk0=(help_p shr 1)
  1678.     tfill( 11, 57, 60, 59, 0)
  1679.     if help_p >= 2 then {
  1680.         tline( 11, 57, 10+wk0, 57,10)
  1681.         tline( 11, 58, 10+wk0, 58, 9)
  1682.         tline( 11, 59, 10+wk0, 59,11)
  1683.     }
  1684. endfunc
  1685.  
  1686. /*[G]= -: Help(select window) : - ====
  1687. /*====----------------------------====
  1688. func HELP(fl;char)
  1689. /*---- -: カーソル ナドヲ ショウキョ :- ----
  1690.     sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  1691.     sp_scrl(101,0,0,0,0)            /* "SP":pick
  1692.     sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  1693.     sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  1694.     sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  1695.     apage(0)
  1696.      fill( 73,  3,252, 68,  0)        /* line cursole clear
  1697.      fill(  3, 73, 68,252,  0)
  1698.      fill( 73, 73,252,252,  0)
  1699.     tfill( 72, 72,255,255, 0)        /* ケイセン clear
  1700.     sp_col2( 1,0, 0)            /* ヒント ヲ ケス
  1701.     sp_col2( 2,0, 0)
  1702.     sp_col2( 4,0, 0)
  1703.     sp_col2( 5,0, 0)
  1704.     sp_out()
  1705.  
  1706.     HELP_MK()                /* window make
  1707.  
  1708.     sp_pat(&H50,wk9,0)
  1709.     tput(100,108,8,8,wk9,"pset")
  1710.     tline(108,116,155,116, 9)
  1711.     cmy=0
  1712.     bgm_no_bk=bgm_no
  1713.  
  1714. /*---- -: Help Main :- ----
  1715.     kb_cls()
  1716.     ston=&HFF
  1717.     sths=&HFF
  1718.     bton=kstrig(1)
  1719.     while 1
  1720.         ST_INP()
  1721.  
  1722.         if kyb = &H1B then break    /* ret. to title
  1723.  
  1724. /*++++ -: カーソル イドウ :- ++++
  1725.         cmyn=cmy
  1726.  
  1727.         if ston = 0 then {
  1728.         if ST1 <> 0 and sths = ST1 then {
  1729.             if ST1 = 2 or ST1 = 8 then {
  1730.                 cmy=cmy+mvof(ST1+10)
  1731.  
  1732.                 if cmy = &HFF then cmy=5
  1733.                 if cmy >= 6 then cmy=0
  1734.  
  1735.                 if cmy <> cmyn then {
  1736.                     play_se(1)
  1737.                     tfill(100,108+(cmyn shl 3),107,115+(cmyn shl 3), 0)
  1738.                     sp_pat(&H50,wk9,0)
  1739.                     tput(100,108+(cmy shl 3),8,8,wk9,"pset")
  1740.  
  1741.                     tline(108,(cmyn shl 3)+116,155,(cmyn shl 3)+116, 0)
  1742.                     tline(108,(cmy  shl 3)+116,155,(cmy  shl 3)+116, 9)
  1743.                 }
  1744.             }
  1745.  
  1746.             if ST1 = 4 or ST1 = 6 then {
  1747. /*---- -: BGM Number Select :- ----
  1748.                 if cmy = 1 then {
  1749.                     play_se(1)
  1750.                     bgm_no=bgm_no+mvof(ST1)
  1751.                     if bgm_no = &HFF then bgm_no=8
  1752.                     if bgm_no = 9 then bgm_no=0
  1753.  
  1754.                     if bgm_no = 8 then {
  1755.                         TFP(108,116,"[OFF][")
  1756.                     } else {
  1757.                         TFP(108,116,"BGM\")
  1758.                         TSP(140,116,bgm_no+1)
  1759.                     }
  1760.                 }
  1761.  
  1762. /*---- -: info. type select :- ++++
  1763.                 if cmy = 3 then {
  1764.                     play_se(1)
  1765.                     inft=inft+mvof(ST1) and 1
  1766.  
  1767.                     sp_pat(&H40+inft,wk9,0)
  1768.                     tput(148,132,8,8,wk9,"pset")
  1769.                     GI_S1()
  1770.                 }
  1771.             }
  1772.         }
  1773.         }
  1774.  
  1775.         if bton = 0 then {
  1776. /*++++ -: "A" ボタン ガ オサレタトキ :- ++++
  1777.             if BT1 = 1 then {
  1778.  
  1779. /*---- -: help hint :- ----
  1780.                 if cmy = 2 then {
  1781.                     if help_p >= 20 then {
  1782.                         play_se(3)
  1783.                         bton=BT1
  1784.                         break
  1785.                     } else {
  1786.                         play_se(6)
  1787.                     }
  1788.                 }
  1789.  
  1790. /*---- -: BGM change/play :- ----
  1791.                 if cmy = 1 then {
  1792.                     play_zmd(15+bgm_no)    /* play "game bgm"
  1793.                     bgm_no_bk=bgm_no
  1794.                 }
  1795.  
  1796. /*---- -: give up/exit :- -----
  1797.                 if cmy = 0 or cmy = 5 then {
  1798.                     play_se(3)
  1799.                     bton=BT1
  1800.                     break
  1801.                 }
  1802.  
  1803. /*---- -: save :- -----
  1804.                 if cmy = 4 then {
  1805.                     RESUME()
  1806.                 }
  1807.                 bton=BT1
  1808.             }
  1809.  
  1810. /*++++ -: "B" ボタン ガ オサレタトキ :- ++++
  1811.             if BT1 = 2 or kyb = &H20 or kyb = &H0D then {
  1812.                 play_se(7)
  1813.                 cmy=3
  1814.                 bton=BT1
  1815.                 break
  1816.             }
  1817.         }
  1818.  
  1819. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  1820.         ST_CK2(16,2)
  1821.  
  1822. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  1823.         if bton <> BT1 then bton=0
  1824.  
  1825.         sp_out()
  1826.     endwhile
  1827.  
  1828.     if kyb = &H1B then return()        /* ret. to title
  1829.  
  1830.     apage(0)
  1831.      fill( 96, 96,161,161, 0)
  1832.     tfill( 96, 96,159,159, 0)
  1833.     KEISEN()
  1834.  
  1835.     if bgm_no <> bgm_no_bk then bgm_no=bgm_no_bk
  1836.     if cmy = 0 then {
  1837.         g_mode=99            /* give up
  1838.         return()
  1839.     }
  1840.     sp_palet( 0,PAL, 0)
  1841.     if cmy = 2 then HELP_HINT(fl)        /* help hint
  1842.  
  1843.     if kyb = &H1B then return()        /* ret. to title
  1844.  
  1845.     if fl = 0 then {
  1846.         sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  1847.         sp_scrl(101,cx_+ 88,cy_+ 80,&H150,3)    /* "SP":pick
  1848.         sp_scrl(104,0,0,0,0)            /* "SP":spark
  1849.         sp_scrl(105,0,0,0,0)
  1850.         sp_scrl(116,cx_+ 84,cy_+ 84,&H140,3)    /* "SP":cs(m)
  1851.         X_LC1()
  1852.         Y_LC1()
  1853.     }
  1854.     if fl = 1 then {
  1855.         sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  1856.         sp_scrl(101,cx_+ 20,cy_+ 78,&H141,3)    /* "SP":pencil
  1857.         sp_scrl(104,0,0,0,0)
  1858.         sp_scrl(105,0,0,0,0)
  1859.         sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  1860.         sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  1861.         sp_scrl(118, 79,cy_+ 84,&H143,3)    /* "SP":cs(x)
  1862.         apage(0)
  1863.         fill( 73,cy_+ 73,xsize*6+ 72,cy_+ 77, 19)    /* line cursole
  1864.     }
  1865.     if fl = 2 then {
  1866.         sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  1867.         sp_scrl(101,cx_+ 90,cy_+  8,&H141,3)    /* "SP":pencil
  1868.         sp_scrl(104,0,0,0,0)
  1869.         sp_scrl(105,0,0,0,0)
  1870.         sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  1871.         sp_scrl(117,cx_+ 84, 79,&H142,3)    /* "SP":cs(y)
  1872.         sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  1873.         apage(0)
  1874.         fill(cx_+ 73, 73,cx_+ 77,ysize*6+ 72, 19)    /* line cursole
  1875.     }
  1876.     sp_out()
  1877. endfunc
  1878.  
  1879. /*[G]= -: Help Window Make :- ====
  1880. /*====------------------------====
  1881. func HELP_MK()
  1882.     apage(0)
  1883.     fill( 98, 98,161,161,177)
  1884.     for i=0 to 3
  1885.         wk0=96+(i shl 4)
  1886.         for j=0 to 3
  1887.             wk1=96+(j shl 4)
  1888.             put(wk1,wk0,wk1+15,wk0+15,BK0)
  1889.         next
  1890.     next
  1891.     tfill( 96, 96,159,159, 8)
  1892.     tfill( 97, 97,158,158,15)
  1893.     tfill( 98, 98,157,157, 8)
  1894.     tfill( 99, 99,156,156, 0)
  1895.     TFP(104,100,"hHELPh")
  1896.     TFP(114,108,"I")
  1897.     TFP(108,108,"G")
  1898.     TFP(120,108,"VE")
  1899.     TFP(140,108,"UP")
  1900.     if bgm_no = 8 then {
  1901.         TFP(108,116,"[OFF][")
  1902.     } else {
  1903.         TFP(108,116,"BGM\")
  1904.         TSP(140,116,bgm_no+1)
  1905.     }
  1906.     if help_p >= 20 then {
  1907.         TFP(114,124,"I")
  1908.         TFP(108,124,"H")
  1909.         TFP(120,124,"NT")
  1910.         TFP(140,124,"OK")
  1911.     } else {
  1912.         TFP(108,124,"iiii")
  1913.     }
  1914.     TFP(108,132,"INFO]")
  1915.     sp_pat(&H40+inft,wk9,0)
  1916.     tput(148,132,8,8,wk9,"pset")
  1917.     TFP(108,140,"SAVE")
  1918.     TFP(108,148,"EXIT")
  1919. endfunc
  1920.  
  1921. /*[G]= -: Help Hint :- ====
  1922. /*====-----------------====
  1923. func HELP_HINT(fl;char)
  1924.     if fl = 1 then {
  1925.         cx=0 : cx_=cx*6
  1926.         cy=py : cx_=cy*6
  1927.     }
  1928.     if fl = 2 then {
  1929.         cx=px : cx_=cx*6
  1930.         cy=0 : cy_=cy*6
  1931.     }
  1932.     sp_scrl(117,cx_+ 84,     79,&H142,3)    /* "SP":cs(y)
  1933.     sp_scrl(118,     79,cy_+ 84,&H143,3)    /* "SP":cs(x)
  1934.     fill( 73,cy_+ 73,xsize*6+ 72,cy_+ 77, 19)    /* ヨコ ノ ライン
  1935.     fill(cx_+ 73, 73,cx_+ 77,ysize*6+ 72, 19)    /* タテ ノ ライン
  1936.     sp_out()
  1937.  
  1938. /*---- -: Help Hint Main :- ----
  1939.     kb_cls()
  1940.     ston=&HFF
  1941.     sths=&HFF
  1942.     bton=kstrig(1)
  1943.     while 1
  1944.         ST_INP()
  1945.  
  1946.         if kyb = &H1B then break    /* ret. to title
  1947.  
  1948. /*---- -: カーソル カラー グラデーション :- ----
  1949.         cs_grd=cs_grd+1 and 31
  1950.         if (cs_grd and 3) = 3 then {
  1951.             sp_col2( 6,(30-(cs_grd shr 2)) shl 6, 1)
  1952.         }
  1953.  
  1954. /*++++ -: カーソル イドウ :- ++++
  1955.         cxn=cx
  1956.         cyn=cy
  1957.  
  1958.         if ston = 0 then {
  1959.         if ST1 <> 0 and sths = ST1 then {
  1960.             cx=cx+mvof(ST1)
  1961.             cy=cy+mvof(ST1+10)
  1962.             if cx = &HFF then cx=0
  1963.             if cx = xsize then cx=xsize-1
  1964.             if cy = &HFF then cy=0
  1965.             if cy = ysize then cy=ysize-1
  1966.  
  1967.             cx_=cx*6
  1968.             cy_=cy*6
  1969.  
  1970.             if cx <> cxn or cy <> cyn then {
  1971.                 play_se(1)
  1972.                 sp_scrl(117,cx_+ 84, 79,&H142,3)    /* "SP":cs(y)
  1973.                 sp_scrl(118, 79,cy_+ 84,&H143,3)    /* "SP":cs(x)
  1974. /*                v_disp()
  1975.                 fill( 73,cyn*6+ 73,xsize*6+ 72,cyn*6+ 77,  0)    /* ヨコ ケシ
  1976.                 fill(cxn*6+ 73, 73,cxn*6+ 77,ysize*6+ 72,  0)    /* タテ ケシ
  1977.                 fill( 73,cy_ +73,xsize*6+ 72,cy_+ 77, 19)    /* ヨコ ノ ライン
  1978.                 fill(cx_+ 73, 73,cx_+ 77,ysize*6+ 72, 19)    /* タテ ノ ライン
  1979.             }
  1980.         }
  1981.         }
  1982.  
  1983. /*++++ -: "A"/"B" ボタン ガ オサレタトキ :- ++++
  1984.         if bton = 0 then {
  1985.             bton=BT1
  1986.             if BT1 = 1 or BT1 = 2 then break
  1987.         }
  1988.  
  1989. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  1990.         ST_CK2(16,2)
  1991.  
  1992. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  1993.         if bton <> BT1 then bton=0
  1994.  
  1995.         sp_out()
  1996.     endwhile
  1997.  
  1998.     if kyb = &H1B then return()        /* ret. to title
  1999.  
  2000.     apage(0)
  2001.     fill( 73, 73,252,252,  0)
  2002.     if BT1 = 2 then {
  2003.         play_se(2)
  2004.         if fl = 1 then {
  2005.             cx_=px*6
  2006.             cy_=py*6
  2007.         }
  2008.         if fl = 2 then {
  2009.             cx_=px*6
  2010.             cy_=py*6
  2011.         }
  2012.         return()            /* help hint cancel
  2013.     }
  2014.     play_se(3)
  2015.     if dbg <> 1 then {
  2016.         help_p=help_p-20
  2017.         HELP_DIS()
  2018.     }
  2019.  
  2020. /*---- -: タテ ノ ライン :- ----
  2021.     cyn=cy
  2022.     for i=0 to ysize-1
  2023.         play_se(1)
  2024.         cy=i
  2025.         cy_=cy*6
  2026.         if (edit_map(cy*30+cx) and 1) = 1 then BT1=1 else {
  2027.             BT1=0
  2028.             sp_scrl(100,0,0,0,0)
  2029.             sp_scrl(101,0,0,0,0)
  2030.             sp_scrl(104,0,0,0,0)
  2031.             sp_scrl(105,0,0,0,0)
  2032.         }
  2033.         sp_scrl(101,cx_+ 88,cy_+ 80,&H150+pen_mode,3)    /* "SP":pick
  2034.         sp_scrl(116,cx_+ 84,cy_+ 84,&H140,3)        /* "SP":cs(m)
  2035.         sp_out()
  2036.  
  2037.         if (flg_map(cy*30+cx) and 1) <> 1 then NML_BLK_P(1)
  2038.     next
  2039.     cy=cyn
  2040.     cy_=cy*6
  2041.  
  2042. /*---- -: ヨコ ノ ライン :- ----
  2043.     cxn=cx
  2044.     for i=0 to xsize-1
  2045.         play_se(1)
  2046.         cx=i
  2047.         cx_=cx*6
  2048.         if (edit_map(cy*30+cx) and 1) = 1 then BT1=1 else {
  2049.             BT1=0
  2050.             sp_scrl(100,0,0,0,0)
  2051.             sp_scrl(101,0,0,0,0)
  2052.             sp_scrl(104,0,0,0,0)
  2053.             sp_scrl(105,0,0,0,0)
  2054.         }
  2055.         sp_scrl(101,cx_+ 88,cy_+ 80,&H150+pen_mode,3)    /* "SP":pick
  2056.         sp_scrl(116,cx_+ 84,cy_+ 84,&H140,3)        /* "SP":cs(m)
  2057.         sp_out()
  2058.  
  2059.         if (flg_map(cy*30+cx) and 1) <> 1 then NML_BLK_P(1)
  2060.     next
  2061.     cx=cxn
  2062.     cx_=cx*6
  2063.  
  2064.     BT1=kstrig(1)
  2065.     if fl = 1 then {
  2066.         cx_=px*6
  2067.         cy_=py*6
  2068.     }
  2069.     if fl = 2 then {
  2070.         cx_=px*6
  2071.         cy_=py*6
  2072.     }
  2073. endfunc
  2074.  
  2075. /*==== -: Resume :- ====
  2076. /*====--------------====
  2077. func RESUME()
  2078. /*---- -: カキコミ デキナイ :- ----
  2079.     if dskok = 0 then {
  2080.         play_se(6)
  2081.         return()
  2082.     }
  2083. /*---- -: ディスクヨウリョウ ガ タリナイ :- ----
  2084.     if dskf(0) <= 1568 then {
  2085.         play_se(6)
  2086.         return()
  2087.     }
  2088.  
  2089.     play_se(3)
  2090.     wk0=fopen(stg_fl+".RES","c")
  2091.     fputc(stage,wk0)            /* stage no.
  2092.     fputc(help_p,wk0)            /* help_p
  2093.     fputc((stg_cmp shr 8),wk0)        /* stg_cmp
  2094.     fputc((stg_cmp and &HFF),wk0)
  2095.     fputc((tim_c shr 24),wk0)        /* tim_c
  2096.     fputc((tim_c shr 16),wk0)
  2097.     fputc((tim_c shr 8),wk0)
  2098.     fputc((tim_c and &HFF),wk0)
  2099.  
  2100.     fwrite(hint_x,330,wk0)
  2101.     fwrite(hint_y,330,wk0)
  2102.     fwrite(flg_map,900,wk0)
  2103.     fclose(wk0)
  2104.  
  2105.     TFP(140,140,"OK")
  2106.     for i=0 to 11
  2107.         v_disp()
  2108.     next
  2109.     TFP(140,140,"__")
  2110.     ldok=1
  2111. endfunc
  2112.  
  2113. /*==== -: Resume Load :- ====
  2114. /*====-------------------====
  2115. func RES_LD1()
  2116.     wk0=fopen(stg_fl+".RES","r")
  2117.     stage=fgetc(wk0)            /* stage no.
  2118.     help_p=fgetc(wk0)            /* help_p
  2119.     wk1=fgetc(wk0)                /* stg_cmp
  2120.     stg_cmp=(wk1 shl 8)+fgetc(wk0)
  2121.     wk1=fgetc(wk0)                /* tim_c
  2122.     wk1=(wk1 shl 8)+fgetc(wk0)
  2123.     wk1=(wk1 shl 8)+fgetc(wk0)
  2124.     tim_c=(wk1 shl 8)+fgetc(wk0)
  2125.  
  2126.     fread(hint_x,330,wk0)
  2127.     fread(hint_y,330,wk0)
  2128.     fread(flg_map,900,wk0)
  2129.     fclose(wk0)
  2130.  
  2131.     try_c=stg_data((stage shl 9)+ 35)    /* try count
  2132.     recd=stg_data((stage shl 9)+ 36) shl 24    /* record
  2133.     recd=recd+(stg_data((stage shl 9)+ 37) shl 16)
  2134.     recd=recd+(stg_data((stage shl 9)+ 38) shl 8)
  2135.     recd=recd+ stg_data((stage shl 9)+ 39)
  2136. endfunc
  2137. func RES_LD2()
  2138.     tfill( 73,  3,252, 68, 0)
  2139.     tfill(  3, 73, 68,252, 0)
  2140.  
  2141. /*---- -: X/Y hint :- ----
  2142.     for i=0 to 29
  2143.     for j=0 to 10
  2144.         wk0=hint_x(i*11+j)
  2145.         if wk0 <> &HFF then {
  2146.             if (wk0 and &H80) = 0 then {
  2147.                 sp_pat(&H00+(wk0 and 127),wk9,0)
  2148.             } else {
  2149.                 sp_pat(&H20+(wk0 and 127),wk9,0)
  2150.             }
  2151.             tput( 63-j*6,i*6+ 73,6,6,wk9,"pset")
  2152.         }
  2153.  
  2154.         wk0=hint_y(i*11+j)
  2155.         if wk0 <> &HFF then {
  2156.             if (wk0 and &H80) = 0 then {
  2157.                 sp_pat(&H00+(wk0 and 127),wk9,0)
  2158.             } else {
  2159.                 sp_pat(&H20+(wk0 and 127),wk9,0)
  2160.             }
  2161.             tput(i*6+ 73, 63-j*6,6,6,wk9,"pset")
  2162.         }
  2163.     next
  2164.     next
  2165.  
  2166. /*---- -: フィールド :- ----
  2167.     apage(1)
  2168.     fill(  8,  8, 39, 39,  4)        /* sample clear
  2169.     for i=0 to ysize-1
  2170.         wk1=i*6
  2171.         for j=0 to xsize-1
  2172.             wk0=flg_map(i*30+j)
  2173.             wk2=j*6
  2174.             if wk0 = 1 then {
  2175.                 put(wk2+ 73,wk1+ 73,wk2+ 78,wk1+ 78,BLK2)
  2176.                 pset(j+  9,i+  9, 12)
  2177.             }
  2178.             if wk0 = 2 then {
  2179.                 put(wk2+ 73,wk1+ 73,wk2+ 78,wk1+ 78,BLK1)
  2180.             }
  2181.         next
  2182.     next
  2183.     svld=0
  2184. endfunc
  2185.  
  2186. /*[G]= -: Game Over :- ====
  2187. /*====-----------------====
  2188. /* use sp.plane : 22-37 > game over logo
  2189. /*        : 30-38 > try again!
  2190. /*        : 39,40 > push
  2191. func GAME_OVER()
  2192.     m_fadeout(40)
  2193. /*---- -: カーソル ナドヲ ショウキョ :- ----
  2194.     sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  2195.     sp_scrl(101,0,0,0,0)            /* "SP":pick
  2196.     sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  2197.     sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  2198.     sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  2199.     sp_col2( 1,0, 0)            /* ヒント ヲ ケス
  2200.     sp_col2( 2,0, 0)
  2201.     sp_col2( 4,0, 0)
  2202.     sp_col2( 5,0, 0)
  2203.     sp_out()
  2204.     apage(0)
  2205.      fill( 73,  3,252, 68,  0)        /* line cursole clear
  2206.      fill(  3, 73, 68,252,  0)
  2207. /*    tfill( 72, 72,255,255, 0)        /* ケイセン clear
  2208.  
  2209.     wk0=0
  2210.     for i=0 to 15
  2211.         wk0=wk0+(16-i)
  2212.         sp_scrl( 22,104,wk0,&H365,3)    /* "SP":game over
  2213.         sp_scrl( 31,112,wk0,&H863,3)
  2214.         sp_scrl( 24,120,wk0,&H366,3)
  2215.         sp_scrl( 33,128,wk0,&H862,3)
  2216.         sp_scrl( 26,144,wk0,&H367,3)
  2217.         sp_scrl( 35,152,wk0,&H868,3)
  2218.         sp_scrl( 28,160,wk0,&H362,3)
  2219.         sp_scrl( 37,168,wk0,&H864,3)
  2220.         wk1=272-wk0
  2221.         sp_scrl( 30,104,wk1,&H865,3)    /* "SP":game over
  2222.         sp_scrl( 23,112,wk1,&H363,3)
  2223.         sp_scrl( 32,120,wk1,&H866,3)
  2224.         sp_scrl( 25,128,wk1,&H362,3)
  2225.         sp_scrl( 34,144,wk1,&H867,3)
  2226.         sp_scrl( 27,152,wk1,&H368,3)
  2227.         sp_scrl( 36,160,wk1,&H862,3)
  2228.         sp_scrl( 29,168,wk1,&H364,3)
  2229.         sp_out()
  2230.     next
  2231.  
  2232. /*---- -: push :- ----
  2233.     play_zmd(13)                /* play "game over"
  2234.     sp_scrl( 30,168,256,&H66A,3)        /* "SP":try again!
  2235.     sp_scrl( 31,176,256,&H664,3)
  2236.     sp_scrl( 32,184,256,&H62F,3)
  2237.     sp_scrl( 33,200,256,&H663,3)
  2238.     sp_scrl( 34,208,256,&H665,3)
  2239.     sp_scrl( 35,216,256,&H663,3)
  2240.     sp_scrl( 36,224,256,&H62A,3)
  2241.     sp_scrl( 37,232,256,&H62E,3)
  2242.     sp_scrl( 38,240,256,&H63E,3)
  2243.     PRS_BT( 39,240,240)
  2244. endfunc
  2245.  
  2246. /*[G]= -: Stage Clear :- ====
  2247. /*====-------------------====
  2248. /* use sp.plane : 22,23,24,25,26,27 > clear logo
  2249. /*        : 30,31 > push
  2250. /*        : 48 - 63 > star
  2251. func STG_CLR()
  2252.     m_fadeout(40)
  2253. /*---- -: カーソル ナドヲ ショウキョ :- ----
  2254.     sp_scrl(100,0,0,0,0)            /* "SP":hanmer
  2255.     sp_scrl(101,0,0,0,0)            /* "SP":pick
  2256.     sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  2257.     sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  2258.     sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  2259.     sp_out()
  2260.     apage(0)
  2261.      fill( 73,  3,252, 68,  0)        /* line cursole clear
  2262.      fill(  3, 73, 68,252,  0)
  2263. /*    tfill( 72, 72,255,255, 0)        /* ケイセン clear
  2264.  
  2265.     for i=0 to 11 : sp_scrl(80+i,0,0,0,0) : next
  2266.     sp_out()
  2267.     sp_scrl( 22,116, 24,&H660,3)        /* "SP":clear
  2268.     sp_scrl( 23,124, 24,&H661,3)
  2269.     sp_scrl( 24,132, 24,&H662,3)
  2270.     sp_scrl( 25,140, 24,&H663,3)
  2271.     sp_scrl( 26,148, 24,&H664,3)
  2272.     sp_scrl( 27,156, 24,&H63E,3)
  2273.  
  2274.     if p_mode = 0 then {
  2275. /*---- -: クリア シタヨ :- ----
  2276.         wk0=stg_data((stage shl 9)+ 34)
  2277.         if (wk0 and 1) = 0 then {
  2278.             stg_data((stage shl 9)+ 34)=wk0 or 1
  2279.  
  2280.             if p_mode = 0 and dbg = 0 and dskok = 1 then {    /* save
  2281.                 wk1=fopen(stg_fl+".DAT","w")
  2282. /*                fwrite(stg_data,51200,wk1)
  2283.                 fseek(wk1,(stage  shl 9)+ 34,0)
  2284.                 fputc(wk0 or 1,wk1)
  2285.                 fclose(wk1)
  2286.             }
  2287.         }
  2288.  
  2289. /*---- -: record check :- ----
  2290.         if tim_c < recd then {
  2291.             sp_scrl( 32,160,256,&H52E,3)    /* "SP":new record!
  2292.             sp_scrl( 33,168,256,&H562,3)
  2293.             sp_scrl( 34,176,256,&H52C,3)
  2294.             sp_scrl( 35,192,256,&H564,3)
  2295.             sp_scrl( 36,200,256,&H562,3)
  2296.             sp_scrl( 37,208,256,&H560,3)
  2297.             sp_scrl( 38,216,256,&H567,3)
  2298.             sp_scrl( 39,224,256,&H564,3)
  2299.             sp_scrl( 40,232,256,&H52D,3)
  2300.             sp_scrl( 41,240,256,&H53E,3)
  2301.  
  2302.             stg_data((stage shl 9)+ 36)=tim_c shr 24
  2303.             stg_data((stage shl 9)+ 37)=(tim_c shr 16) and &HFF
  2304.             stg_data((stage shl 9)+ 38)=(tim_c shr 8) and &HFF
  2305.             stg_data((stage shl 9)+ 39)=tim_c and &HFF
  2306.  
  2307.             if p_mode = 0 and dbg = 0 and dskok = 1 then {    /* save
  2308.                 wk0=fopen(stg_fl+".DAT","w")
  2309.                 fseek(wk0,(stage shl 9)+ 36,0)
  2310.                 fputc(tim_c shr 24,wk0)
  2311.                 fputc((tim_c shr 16) and &HFF,wk0)
  2312.                 fputc((tim_c shr 8) and &HFF,wk0)
  2313.                 fputc(tim_c and &HFF,wk0)
  2314.                 fclose(wk0)
  2315.             }
  2316.         }
  2317.     }
  2318.  
  2319. /*---- -: star para. set :- ----
  2320.     for i=0 to 15
  2321.         star_x(i)=rand() and &HE0    /* &HF0
  2322.         star_y(i)=rand() and &HE0    /* &HF0
  2323.     next
  2324.  
  2325.     STG_CLR_S1()                /* マワリ クロクスル
  2326.     STG_CLR_S2()                /* カンセイ コピー
  2327.  
  2328. /*---- -: push :- ----
  2329.     play_zmd(14)                /* play "stage clear"
  2330.  
  2331.     kb_cls()
  2332.     bton=kstrig(1)
  2333.     while 1
  2334.         ST_INP()
  2335.  
  2336. /*---- -: push anime :- ----
  2337.         piko(0)=piko(0)+1 and 15
  2338.         if piko(0) = 0 then {
  2339.             piko(1)=piko(1)+1 and 1
  2340.             sp_scrl( 30,256,244+(piko(1) shl 1),&H16F,3)    /* "SP":hand
  2341.             sp_scrl( 31,256,256,&H16D+piko(1),3)        /* "SP":button
  2342.         }
  2343.  
  2344. /*---- -: star move :- ----
  2345.         for i=0 to 1
  2346.             star_x(i  )=star_x(i  )-4 and 255
  2347.             star_y(i  )=star_y(i  )+4 and 255
  2348.             star_x(i+2)=star_x(i+2)-2 and 255
  2349.             star_y(i+2)=star_y(i+2)+2 and 255
  2350.             star_x(i+4)=star_x(i+4)-2 and 255
  2351.             star_y(i+4)=star_y(i+4)+2 and 255
  2352.             star_x(i+6)=star_x(i+6)-1 and 255
  2353.             star_y(i+6)=star_y(i+6)+1 and 255
  2354.  
  2355.             star_x(i+8)=star_x(i+8)-1 and 255
  2356.             star_y(i+8)=star_y(i+8)+1 and 255
  2357.             star_x(i+10)=star_x(i+10)-1 and 255
  2358.             star_y(i+10)=star_y(i+10)+1 and 255
  2359.         next
  2360.         wk3=wk3-1 and 15
  2361.         sp_scrl( 48,star_x(0)+8,star_y(0)+8,&H578+((wk3 shr 2) shl 3),3)
  2362.         sp_scrl( 49,star_x(1)+8,star_y(1)+8,&H57C+((wk3 shr 2) shl 3),3)
  2363.         for i=0 to 7
  2364.             sp_scrl( 50+i,star_x(2+i)+8,star_y(2+i)+8,&H578+i+((wk3 shr 2) shl 3),3)
  2365.         next
  2366.         sp_scrl( 58,star_x(10)+8,star_y(10)+8,&H578+((wk3 shr 2) shl 3),3)
  2367.         sp_scrl( 59,star_x(11)+8,star_y(11)+8,&H57A+((wk3 shr 2) shl 3),3)
  2368.  
  2369. /*++++ -: ボタン ガ オサレタトキ :- ++++
  2370.         if bton = 0 and BT1 <> 0 then {
  2371.             play_se(3)
  2372.             break
  2373.         }
  2374.  
  2375.         if bton <> BT1 then bton=0
  2376.  
  2377.         sp_out()
  2378.     endwhile
  2379.  
  2380.     v_priority("STG","01")            /* プライオリティ (SP>TX>GR)
  2381.     v_special(3)                /* ハントウメイ (ベース+セカンド)
  2382.     SCR_ALL_OFF()
  2383.     sp_palet( 0,PAL, 0)
  2384.     sp_out()
  2385. endfunc
  2386. func STG_CLR_S1()
  2387.     int n0=384,n1=639,n2=639,xck,yck
  2388.     dim char ilp(6)={0,39,24,9,5,20,35}
  2389.     xck=456+xsize*6
  2390.     yck=456+ysize*6
  2391. /*---- -: マスク :- ----
  2392.     tfill(384,384,639,639,0) : thome(384,384)
  2393.     while 1
  2394. /*        v_disp()
  2395.         if n0 <> 457 then {
  2396.             tline(n0,384,n0,639,8)
  2397.             tline(384,n0,639,n0,8)
  2398.             n0=n0+1
  2399.         }
  2400.         if n1 <> xck then {
  2401.             tline(n1,384,n1,639,8)
  2402.             n1=n1-1
  2403.         }
  2404.         if n2 <> yck then {
  2405.             tline(384,n2,639,n2,8)
  2406.             n2=n2-1
  2407.         }
  2408.         if n0 = 457 and n1 = xck and n2 = yck then break
  2409.     endwhile
  2410.  
  2411. /*----- -: スクロール :- ----
  2412.     n0=ilp(xsize/5)
  2413.     n1=ilp(ysize/5)
  2414.     vpage(2)
  2415.     if xsize <= 15 then {
  2416.         for i=1 to n0
  2417.             v_disp()
  2418.             home(1,512-i,0)
  2419.             thome(384-i,384)
  2420.         next
  2421.         n0=512-i
  2422.         n2=384-i
  2423.     } else {
  2424.         for i=1 to n0
  2425.             v_disp()
  2426.             home(1,i,0)
  2427.             thome(384+i,384)
  2428.         next
  2429.         n0=i
  2430.         n2=384+i
  2431.     }
  2432.     if ysize <= 15 then {
  2433.         for i=1 to n1
  2434.             v_disp()
  2435.             home(1,n0,512-i)
  2436.             thome(n2,384-i)
  2437.         next
  2438.     } else {
  2439.         for i=1 to n1
  2440.             v_disp()
  2441.             home(1,n0,i)
  2442.             thome(n2,384+i)
  2443.         next
  2444.     }
  2445. endfunc
  2446. func STG_CLR_S2()
  2447.     dim char a(6)={0,113,98,83,68,53,38}
  2448.     char x,y
  2449.     x=128-xsize*3
  2450.     y=128-ysize*3
  2451. /*---- -: バック :- ----
  2452.     apage(0)
  2453.     fill(  0,  0,255,255,  0)
  2454.     tfill(  0,  0,255,255, 0)
  2455.     for i=0 to 7
  2456.         tfill(  0,244-i*12,255,255-i*12,15-i)
  2457.         sp_col2(15-i,rgb(12-i,8-i,14-i),0)
  2458.     next
  2459.     sp_out()
  2460. /*---- -: ワク :- ----
  2461.     fill(x-3,y-3,x+xsize*6+3,y+ysize*6+3, 12)
  2462.     fill(x-4,y-4,x+xsize*6+2,y+ysize*6+2,  4)
  2463.     fill(x-1,y-1,x+xsize*6-1,y+ysize*6-1, 16)
  2464.     line(x-4,y-4,x-4,y+ysize*6+2,  2,&HA5A5)
  2465.     line(x-4,y-4,x+xsize*6+2,y-4,  2,&HA5A5)
  2466. /*---- -: コピー :- ----
  2467.     for i=0 to ysize/5-1
  2468.         wk0=i*30
  2469.         for j=0 to xsize/5-1
  2470.             wk1=j*30
  2471.             apage(1)
  2472.             get(73+wk1,73+wk0,102+wk1,102+wk0,wkA)
  2473.             apage(0)
  2474.             put(x+wk1,y+wk0,x+wk1+29,y+wk0+29,wkA)
  2475.         next
  2476.     next
  2477.  
  2478.     v_disp()
  2479.     v_priority("GST","01")            /* プライオリティ (GR>SP>TX)
  2480.     v_special(0)                /* ハントウメイ オフ
  2481.     vpage(1)
  2482.     thome(0,0)
  2483. endfunc
  2484.  
  2485. /*==== -: Complete Picture Display :- ====
  2486. /*====--------------------------------====
  2487. /* use sp.plane : 0,1 > push
  2488. /*        : 2 - 7 > plate
  2489. /*        : 8 - 23 > congratulations!
  2490. /*        : 24 - 26 > ピクチャークロスワード
  2491. /*        : 34 - 57 > PX logo
  2492. /*        : 58 - 62 > time count
  2493. func CMP_PIC_DIS()
  2494.     home(0,  0,  0) : home(1,256,256)
  2495.     play_zmd(12)                /* play "picture display"
  2496.  
  2497. /*---- -: キレイニ スル :- ----
  2498.     apage(1)                /* active "1" make.
  2499.     fill(318,278,497,457,  0)        /* zoom complete
  2500.     for i=0 to 23
  2501.         put(312+(i shl 3),400,319+(i shl 3),463,DSP_BK)
  2502.     next
  2503.     for i=0 to 5
  2504.         wk0=(i shl 5)+272
  2505.         put(304,wk0   ,319,wk0+ 7,BK4S0)
  2506.         put(304,wk0+16,319,wk0+23,BK4S1)
  2507.  
  2508.         put(496,wk0   ,511,wk0+ 7,BK4S0)
  2509.         put(496,wk0+16,511,wk0+23,BK4S1)
  2510.     next
  2511.     line(264,267,503,267,164)        /* logo line
  2512.     line(265,268,502,268,164)
  2513.     line(268,271,507,271,176)
  2514.     line(269,272,506,272,176)
  2515.     fill(266,322,305,361,176)        /* mono/color カゲ
  2516.     fill(266,386,305,425,176)
  2517.     put(264,320,303,359,DSP_MN)        /* bit complete
  2518.     put(264,384,303,423,DSP_CL)        /* pic complete
  2519.  
  2520. /*---- -: カンセイズ ヲ ヒョウジ :- ----
  2521.     wk0=xsize/5
  2522.     wk1=ysize/5
  2523.     TILING()                /* タイルジョウニスル
  2524.     apage(1)
  2525.     for i=0 to ysize-1
  2526.         dsp_y=dsp_of(8+wk1)+i*6-40
  2527.         for j=0 to xsize-1
  2528.             wk2=edit_map(i*30+j)
  2529.             dsp_x=dsp_of(8+wk0)+j*6
  2530.             fill(dsp_x,dsp_y,dsp_x+5,dsp_y+5, 24+(wk2 and 14))
  2531.  
  2532.             if (wk2 and 1) = 1 then {
  2533.                 pset(dsp_of(wk0)+j,dsp_of(wk1)+56+i, 12)
  2534.             }
  2535.  
  2536.             pset(dsp_of(wk0)+j,dsp_of(wk1)+120+i, 24+(wk2 and 14))
  2537.         next
  2538.     next
  2539.  
  2540. /*---- -: title display :- ----
  2541.     for i=0 to 11
  2542.         TFP2(i*10+ 92,228,stg_name(i))
  2543.     next
  2544.  
  2545. /*---- -: etc. objects set :- ----
  2546.     sp_scrl(  2, 32,120,&H43A,3)        /* "SP":mono plate
  2547.     sp_scrl(  3, 48,120,&H43B,3)
  2548.     sp_scrl(  4, 32,184,&H43C,3)        /* "SP":color plate
  2549.     sp_scrl(  5, 48,184,&H43D,3)
  2550.     sp_scrl(  6,158,224,&H46B,3)        /* "SP":zoom plate
  2551.     sp_scrl(  7,174,224,&H46C,3)
  2552.     sp_scrl(  8, 76, 16,&H360,3)        /* "SP":congratulations!
  2553.     sp_scrl(  9, 84, 16,&H467,3)
  2554.     sp_scrl( 10, 92, 16,&H52E,3)
  2555.     sp_scrl( 11,100, 16,&H665,3)
  2556.     sp_scrl( 12,108, 16,&H764,3)
  2557.     sp_scrl( 13,116, 16,&H863,3)
  2558.     sp_scrl( 14,124, 16,&H36A,3)
  2559.     sp_scrl( 15,132, 16,&H42B,3)
  2560.     sp_scrl( 16,140, 16,&H561,3)
  2561.     sp_scrl( 17,148, 16,&H663,3)
  2562.     sp_scrl( 18,156, 16,&H76A,3)
  2563.     sp_scrl( 19,164, 16,&H82A,3)
  2564.     sp_scrl( 20,172, 16,&H367,3)
  2565.     sp_scrl( 21,180, 16,&H42E,3)
  2566.     sp_scrl( 22,188, 16,&H569,3)
  2567.     sp_scrl( 23,196, 16,&H63E,3)
  2568.     sp_scrl( 24, 24,212,&H145,3)        /* "SP":ピクチャークロスワード
  2569.     sp_scrl( 25, 40,212,&H149,3)
  2570.     sp_scrl( 26, 56,212,&H14B,3)
  2571.     for i=0 to 3                /* "SP":PX logo
  2572.         sp_scrl( 34+i, 16+(i shl 4),232,&H370+i,3)
  2573.         sp_scrl( 38+i, 16+(i shl 4),248,&H374+i,3)
  2574.         sp_scrl( 42+i, 20+(i shl 4),236,&H470+i,3)
  2575.         sp_scrl( 46+i, 20+(i shl 4),252,&H474+i,3)
  2576.         sp_scrl( 50+i, 12+(i shl 4),228,&H570+i,3)
  2577.         sp_scrl( 54+i, 12+(i shl 4),244,&H574+i,3)
  2578.     next
  2579.     sp_out()
  2580.  
  2581. /*---- -: no./time :- ----
  2582.     apage(1)
  2583.     fill(260,276,307,315, 62)
  2584.     for i=0 to 4
  2585.         wk0=(i shl 3)+276
  2586.         put(260,wk0,267,wk0+7,REPT4)
  2587.         put(300,wk0,307,wk0+7,REPT5)
  2588.     next
  2589.     for i=0 to 5
  2590.         wk0=(i shl 3)+260
  2591.         put(wk0,276,wk0+7,283,REPT6)
  2592.         put(wk0,308,wk0+7,315,REPT7)
  2593.     next
  2594.     put(260,276,267,283,REPT0)
  2595.     put(260,308,267,315,REPT1)
  2596.     put(300,276,307,283,REPT2)
  2597.     put(300,308,307,315,REPT3)
  2598.     sp_scrl( 58, 24, 40,&H248,3)    /* "SP":モンダイ
  2599.     SSP3( 59, 36, 40,stage+1,&H230,0)    /* stage
  2600.     sp_scrl( 64, 40, 56,&H24F,3)    /* "SP":':'
  2601.     SSP2( 62, 20, 56,tim_w / 60,&H230,0)    /* min.
  2602.     SSP2( 65, 44, 56,tim_w mod 60,&H230,3)    /* sec.
  2603.  
  2604.     vpage(2+tile) : sp_disp(1) : TX_DISP(1)
  2605.     wk1=0                    /* back palet
  2606.     wk2=128
  2607.  
  2608. /*---- -: push :- ----
  2609.     kb_cls()
  2610.     ston=&HFF
  2611.     sths=&HFF
  2612.     bton=kstrig(1)
  2613.     while 1
  2614.         ST_INP()
  2615.  
  2616. /*---- -: push anime :- ----
  2617.         piko(0)=piko(0)+1 and 15
  2618.         if piko(0) = 0 then {
  2619.             piko(1)=piko(1)+1 and 1
  2620.             sp_scrl( 30,256,244+(piko(1) shl 1),&H16F,3)    /* "SP":hand
  2621.             sp_scrl( 31,256,256,&H16D+piko(1),3)        /* "SP":button
  2622.         }
  2623.  
  2624. /*++++ -: タイル on/off :- ++++
  2625.         if ston = 0 and ST1 <> 0 then {
  2626.             tile=tile+1 and 1
  2627.             vpage(2+tile)
  2628.             ston=ST1
  2629.         }
  2630.         if ston <> ST1 then ston=0
  2631.  
  2632. /*++++ -: ボタン ガ オサレタトキ :- ++++
  2633.         if BT1 <> 0 and bton = 0 then {
  2634.             play_se(3)
  2635.             break
  2636.         }
  2637.  
  2638.         if bton <> BT1 then bton=0
  2639.  
  2640.         sp_out()
  2641.  
  2642. /*---- -: palet change :- ----
  2643.         wk1=wk1+1 and 1023
  2644.         if (wk1 and 7) = 0 then {
  2645.             if (wk1 shr 9) = 0 then {
  2646.                 wk2=wk2+1
  2647.             } else {
  2648.                 wk2=wk2-1
  2649.             }
  2650.  
  2651.             PL_S( 55,hsv(wk2,15,13))
  2652.             PL_S( 56,hsv(wk2,15,12))
  2653.             PL_S( 57,hsv(wk2,15,11))
  2654.             PL_S( 58,hsv(wk2,15,10))
  2655.             PL_S( 59,hsv(wk2,15, 9))
  2656.             PL_S( 60,hsv(wk2,15, 8))
  2657.             PL_S( 61,hsv(wk2,15, 7))
  2658.             PL_S( 62,hsv(wk2,15, 6))
  2659.         }
  2660.     endwhile
  2661.  
  2662.     m_fadeout(40)
  2663.     SCR_ALL_OFF()
  2664. endfunc
  2665.  
  2666. /*[G]= -: Picture Tiling Texture :- ====
  2667. /*====------------------------------====
  2668. func TILING()
  2669.     apage(0)                /* タイル フウニ スル
  2670.     fill( 62, 22,241,201,  0)
  2671.     for i=0 to ysize-1
  2672.         dsp_y=dsp_of(8+wk1)+i*6-296
  2673.         for j=0 to xsize-1
  2674.             dsp_x=dsp_of(8+wk0)+j*6-256
  2675. /*            box(dsp_x  ,dsp_y  ,dsp_x+4,dsp_y+4,191)
  2676.             box(dsp_x+1,dsp_y+1,dsp_x+5,dsp_y+5,177)
  2677.             fill(dsp_x+1,dsp_y+1,dsp_x+4,dsp_y+4,  0)
  2678.             pset(dsp_x,dsp_y,207)
  2679.         next
  2680.     next
  2681. endfunc
  2682.  
  2683. /*====--------------------------------------------------====
  2684. /*====             -: Editor :-             ====
  2685. /*====--------------------------------------------------====
  2686.  
  2687. /*[E]= -: Edit Tools :- ====
  2688. /*====------------------====
  2689. /* use sp.plane : 104,105,106 > title input
  2690. /*          100,101 > press button
  2691. /*          104 > select palet
  2692. /*          105,106,107 > R,G,B level
  2693. /*          117,118 > hint check cursole
  2694. func TOOLS()
  2695. /*---- -: カーソル ナドヲ ショウキョ :- ----
  2696.     sp_scrl(101,0,0,0,0)            /* "SP":pick
  2697.     sp_scrl(116,0,0,0,0)            /* "SP":cs(m)
  2698. /*    sp_scrl(117,0,0,0,0)            /* "SP":cs(y)
  2699. /*    sp_scrl(118,0,0,0,0)            /* "SP":cs(x)
  2700.     sp_out()
  2701.     apage(0)
  2702. /*     fill( 73,  3,252, 68,  0)        /* line cursole clear
  2703. /*     fill(  3, 73, 68,252,  0)
  2704.     tfill( 72, 72,255,255, 0)        /* ケイセン clear
  2705.  
  2706.     TOOLS_DIS()                /* tools window
  2707.     sp_out()
  2708.  
  2709.     sp_pat(&H50,wk9,0)
  2710.     tput(132, 84,8,8,wk9,"pset")
  2711.     tline(140, 92,251, 92, 9)
  2712.     cmy=0
  2713.  
  2714. /*---- -: Tools Main :- ----
  2715.     kb_cls()
  2716.     ston=&HFF
  2717.     sths=&HFF
  2718.     bton=kstrig(1)
  2719.     while 1
  2720.         ST_INP()
  2721.  
  2722.         if kyb = &H1B then break    /* ret. to title
  2723.  
  2724. /*++++ -: カーソル イドウ :- ++++
  2725.         cmyn=cmy
  2726.  
  2727.         if ston = 0 then {
  2728.             if ST1 = 2 or ST1 = 8 then {
  2729.             if sths = ST1 then {
  2730.                 cmy=cmy+mvof(ST1+10)
  2731.                 if cmy = &HFF then cmy=20
  2732.                 if cmy = 21 then cmy=0
  2733.  
  2734.                 if cmy <> cmyn then {
  2735.                     play_se(1)
  2736.                     tfill(132,(cmyn shl 3)+ 84,139,(cmyn shl 3)+ 91, 0)
  2737.                     sp_pat(&H50,wk9,0)
  2738.                     tput(132,(cmy shl 3)+ 84,8,8,wk9,"pset")
  2739.  
  2740.                     tline(140,(cmyn shl 3)+ 92,251,(cmyn shl 3)+ 92, 0)
  2741.                     tline(140,(cmy  shl 3)+ 92,251,(cmy  shl 3)+ 92, 9)
  2742.                 }
  2743.             }
  2744.             }
  2745.  
  2746. /*++++ -: イジクリ マワス :- ++++
  2747.             if ST1 = 4 or ST1 = 6 then {
  2748.             if sths = ST1 then {
  2749.  
  2750. /*---- -: stage number up/down :- ----
  2751.                 if cmy =  0 then {
  2752.                     play_se(1)
  2753.                     stage=stage+mvof(ST1)
  2754.                     if stage = &HFF then stage=99
  2755.                     if stage = 100 then stage=0
  2756.                     TSP3(224, 84,stage+1)
  2757.                 }
  2758.  
  2759. /*---- -: edit mode select :- ----
  2760.                 if cmy = 1 then {
  2761.                     play_se(1)
  2762.                     pen_mode=pen_mode+mvof(ST1) and 1
  2763.                     if pen_mode = 0 then {
  2764.                         TFP(212, 92,"@BIT")
  2765.                         TFP(184,132,"BIT\")
  2766.                         sp_pat(&H40+flbt,wk9,0)
  2767.                         tput(216,132,8,8,wk9,"pset")
  2768.                         TFP( 48, 56,"BT")
  2769.                     }
  2770.                     if pen_mode = 1 then {
  2771.                         TFP(212, 92,"@PIC")
  2772.                         tfill(184,132,223,139, 0)
  2773.                         TFP( 48, 56,"PC")
  2774.                     }
  2775.                 }
  2776.  
  2777. /*---- -: active color select :- ----
  2778.                 if cmy = 2 then {
  2779.                     play_se(1)
  2780.                     pen_c=pen_c+mvof(ST1) and 7
  2781.                     PEN_C_SEL()
  2782.                     tline(140,(cmy  shl 3)+ 92,251,(cmy  shl 3)+ 92, 9)
  2783.                 }
  2784.  
  2785. /*---- -: active color "R" level up/down :- ----
  2786.                 if cmy = 3 then {
  2787.                     play_se(1)
  2788.                     pc_r=pc_r+mvof(ST1) and 31
  2789.                     PC_R_P()
  2790.                     PC_CHANGE()
  2791.                 }
  2792.  
  2793. /*---- -: active color "G" level up/down :- ----
  2794.                 if cmy = 4 then {
  2795.                     play_se(1)
  2796.                     pc_g=pc_g+mvof(ST1) and 31
  2797.                     PC_G_P()
  2798.                     PC_CHANGE()
  2799.                 }
  2800.  
  2801. /*---- -: active color "B" level up/down :- ----
  2802.                 if cmy = 5 then {
  2803.                     play_se(1)
  2804.                     pc_b=pc_b+mvof(ST1) and 31
  2805.                     PC_B_P()
  2806.                     PC_CHANGE()
  2807.                 }
  2808.  
  2809. /*---- -: フィル ビット チェンジ :- ----
  2810.                 if cmy = 6 and pen_mode = 0 then {
  2811.                     play_se(1)
  2812.                     flbt=flbt+1 and 1
  2813.                     sp_pat(&H40+flbt,wk9,0)
  2814.                     tput(216,132,8,8,wk9,"pset")
  2815.                 }
  2816.  
  2817. /*---- -: shift flag change :- ----
  2818.                 if cmy = 7 then {
  2819.                     play_se(1)
  2820.                     shf=shf+mvof(ST1) and 3
  2821.                     TFP(192,140,shf_s(shf))
  2822.                 }
  2823.  
  2824. /*---- -: mirror flag change :- ----
  2825.                 if cmy = 9 then {
  2826.                     play_se(1)
  2827.                     mir=mir+mvof(ST1) and 1
  2828.                     TFP(196,156,mir_s(mir))
  2829.                 }
  2830.  
  2831. /*---- -: x_size チェンジ :- ----
  2832.                 if cmy = 10 then {
  2833.                     play_se(1)
  2834.                     xsize=xsize+mvof(ST1)*5
  2835.                     if xsize = 0 then xsize=5
  2836.                     if xsize >= 35 then xsize=30
  2837.                     TSP(196,164,xsize)        /* tools win
  2838.                     TSP( 48, 40,xsize)        /* para. win
  2839.                     XSIZE_C()
  2840.                 }
  2841.  
  2842. /*---- -: y_size チェンジ :- ----
  2843.                 if cmy = 11 then {
  2844.                     play_se(1)
  2845.                     ysize=ysize+mvof(ST1)*5
  2846.                     if ysize = 0 then ysize=5
  2847.                     if ysize >= 35 then ysize=30
  2848.                     TSP(196,172,ysize)        /* tools win
  2849.                     TSP( 48, 48,ysize)        /* para. win
  2850.                     YSIZE_C()
  2851.                 }
  2852.             }
  2853.             }
  2854.         }
  2855.  
  2856.         if BT1 = 1 then {
  2857. /*++++ -: "A"ボタン ガ オサレタトキ :- ++++
  2858.         if bton = 0 then {
  2859.             if cmy = 6 then EDIT_FILL()        /* -: fill :-
  2860.             if cmy = 7 then SHIFT()            /* -: edit data shift :-
  2861.             if cmy = 8 then EDIT_XOR()        /* -: edit data reverse :-
  2862. /*            if cmy = 9 then SWAP()            /* -: edit data swap :-
  2863.             if cmy = 9 then MIRROR()        /* -: edit data mirror :-
  2864.  
  2865.             if cmy = 12 then EDIT_ALL_INIT(1)    /* -: edit all init :-
  2866.             if cmy = 13 then EDIT_PAL_DEF()        /* -: edit palet >>> defalt :-
  2867.             if cmy = 14 then HINT_CHECK()        /* -: edit data hint check :-
  2868.             if cmy = 15 then STG_TIT_IN()        /* -: title input :-
  2869.             if cmy = 16 then EDIT_SAVE(1)        /* -: edit_data >>> user_data :-
  2870.             if cmy = 17 then EDIT_LOAD()        /* -: edit_data <<< user_data :-
  2871.             if cmy = 18 then DATA_SAVE()        /* -: user_data save :-
  2872.             if cmy = 19 then DATA_LOAD()        /* -: user_data load :-
  2873.  
  2874.             bton=BT1
  2875.             if cmy = 20 then {            /* -: return to title :-
  2876.                 play_se(3)
  2877.                 kyb=&H1B
  2878.                 break
  2879.             }
  2880.         }
  2881.         }
  2882.  
  2883. /*++++ -: tools exit :- ++++
  2884.         if BT1 >= 2 or kyb = &H20 or kyb = &H0D then {
  2885.         if bton = 0 then {
  2886.             play_se(7)
  2887.             bton=BT1
  2888.             break
  2889.         }
  2890.         }
  2891.  
  2892. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  2893.         ST_CK2(16,2)
  2894.  
  2895. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  2896.         if bton <> BT1 then bton=0
  2897.  
  2898.         sp_out()
  2899.     endwhile
  2900.  
  2901.     apage(0)
  2902.      fill(128, 80,255,255, 0)
  2903.     tfill(128, 80,255,255, 0)
  2904.     KEISEN()
  2905.     if cx >= xsize then {
  2906.         cx=xsize-1
  2907.         cx_=cx*6
  2908.         TSP( 24, 40,cx+1)
  2909.     }
  2910.     if cy >= ysize then {
  2911.         cy=ysize-1
  2912.         cy_=cy*6
  2913.         TSP( 24, 48,cy+1)
  2914.     }
  2915.     sp_scrl(101,cx_+ 88,cy_+ 80,&H150+pen_mode,3)    /* "SP":pick/pen
  2916.     sp_scrl(116,cx_+ 84,cy_+ 84,&H140,3)        /* "SP":cs(m)
  2917.     sp_scrl(104,0,0,0,0)
  2918.     sp_scrl(105,0,0,0,0)
  2919.     sp_scrl(106,0,0,0,0)
  2920.     sp_scrl(107,0,0,0,0)
  2921.     sp_scrl(117,0,0,0,0)
  2922.     sp_scrl(118,0,0,0,0)
  2923.     sp_out()
  2924. endfunc
  2925.  
  2926. /*[E]= -: Tools Display Make :- ====
  2927. /*====--------------------------====
  2928. func TOOLS_DIS()
  2929. /*---- -: tools window open -: ----
  2930.     apage(0)
  2931.     for i=0 to 10
  2932.         wk0=80+(i shl 4)
  2933.         for j=0 to 7
  2934.             wk1=128+(j shl 4)
  2935.             put(wk1,wk0,wk1+15,wk0+15,BK0)
  2936.         next
  2937.     next
  2938.     tfill(128, 80,255,255, 8)
  2939.     tfill(129, 81,254,254,15)
  2940.     tfill(130, 82,253,253, 8)
  2941.     tfill(131, 83,252,252, 0)
  2942.  
  2943. /*---- -: command list :- ----
  2944.     TFP(140, 84,"TARGET")            /* TARGET STG:000
  2945.     TFP(192, 84,"STG\")
  2946.     TSP3(224, 84,stage+1)
  2947.     TFP(140, 92,"EDIT")            /* EDIT MODE>BIT
  2948.     TFP(176, 92,"MODE")
  2949.     if pen_mode = 0 then TFP(212, 92,"@BIT")
  2950.     if pen_mode = 1 then TFP(212, 92,"@PIC")
  2951.     TFP(140,100,"COLOR")            /* COLOR
  2952.     apage(0)
  2953.     for i=0 to 7
  2954.         fill(189+(i shl 3),101,195+(i shl 3),107, 16)
  2955.         fill(188+(i shl 3),100,194+(i shl 3),106, 24+(i shl 1))
  2956.     next
  2957.     TFP(140,108,"R")
  2958.     TFP(140,116,"G")
  2959.     TFP(140,124,"B")
  2960.     for i=0 to 2                /* R,G,B レベル ゲージ
  2961.         for j=0 to 31
  2962.             tpset(164+(j shl 1),111+(i shl 3),15)
  2963.             tpset(165+(j shl 1),112+(i shl 3), 1)
  2964.         next
  2965.         tpset(164,110+(i shl 3),15)
  2966.         tpset(165,111+(i shl 3), 1)
  2967.         for j=0 to 3
  2968.             tpset(178+(j shl 4),110+(i shl 3),15)
  2969.             tpset(178+(j shl 4),111+(i shl 3), 1)
  2970.         next
  2971.     next
  2972.     fill(229,109,251,123, 16)
  2973.     PEN_C_SEL()
  2974.     TFP(140,132,"FILL")            /* FILL
  2975.     if pen_mode = 0 then {
  2976.         TFP(184,132,"BIT\")        /* BIT:0
  2977.         sp_pat(&H40+flbt,wk9,0)
  2978.         tput(216,132,8,8,wk9,"pset")
  2979.     }
  2980.     TFP(140,140,"SHIFT")            /* SHIFT
  2981.     TFP(184,140,"@"+shf_s(shf))
  2982.     TFP(140,148,"BIT")            /* BIT REVERSE
  2983.     TFP(168,148,"REVERSE")
  2984.  
  2985. /*    TFP(140,156,"SWAP")            /* SWAP
  2986. /*    TFP(200,156,"^")
  2987. /*    TSP3(176,156,swp_s0)
  2988. /*    TSP3(208,156,swp_s1)
  2989.     TFP(140,156,"MIRROR")            /* MIRROR
  2990.     TFP(196,156,mir_s(mir))
  2991.  
  2992.     TFP(140,164,"X[SIZE\")            /* X-SIZE:
  2993.     TSP(196,164,xsize)
  2994.     TFP(140,172,"Y[SIZE\")            /* Y-SIZE:
  2995.     TSP(196,172,ysize)
  2996.     TFP(140,180,"EDIT")            /* EDIT ALL INIT.
  2997.     TFP(176,180,"ALL")
  2998.     TFP(204,180,"INIT]")
  2999.     TFP(140,188,"DEFALT")            /* DEFALT PALET
  3000.     TFP(192,188,"PALET")
  3001.     TFP(140,196,"HINT")            /* HINT CHECK
  3002.     TFP(176,196,"CHECK")
  3003.     TFP(140,204,"TITLE")            /* TITLE INPUT
  3004.     TFP(184,204,"INPUT")
  3005.     TFP(140,212,"EDIT")            /* EDIT SAVE
  3006.     TFP(176,212,"SAVE")
  3007.     TFP(140,220,"EDIT")            /* EDIT LOAD
  3008.     TFP(176,220,"LOAD")
  3009.     TFP(140,228,"DATA")            /* DATA SAVE
  3010.     TFP(176,228,"SAVE")
  3011.     TFP(140,236,"DATA")            /* DATA LOAD
  3012.     TFP(176,236,"LOAD")
  3013.     TFP(140,244,"RETURN")            /* RETURN TO TITLE
  3014.     TFP(192,244,"TO")
  3015.     TFP(212,244,"TITLE")
  3016. endfunc
  3017.  
  3018. /*[E]= -: Active Color :- ====
  3019. /*====--------------------====
  3020. func PEN_C_SEL()
  3021. /*---- -: active color display :- ----
  3022.     sp_scrl(104,200+(pen_c shl 3),112,&H146,3)    /* "SP":active color
  3023.     apage(0)
  3024.     fill(228,108,250,130, 24+(pen_c shl 1))    /* tools win
  3025.     fill( 24, 56, 30, 62, 24+(pen_c shl 1))    /* para, win
  3026.     sp_col2( 7,edit_palet(pen_c), 1)
  3027.  
  3028. /*-:- パレット ジョウホウ ヨミコミ -:-
  3029.     wk0=edit_palet(pen_c)
  3030.     pc_r=(wk0 shr 6) and 31
  3031.     pc_g= wk0 shr 11
  3032.     pc_b=(wk0 shr 1) and 31
  3033.  
  3034. /*-:- R,G,B level disp. -:-
  3035.     PC_R_P()
  3036.     PC_G_P()
  3037.     PC_B_P()
  3038. endfunc
  3039. func PC_R_P()
  3040.     TSP(148,108,pc_r)
  3041.     sp_scrl(105,173+(pc_r shl 1),120,&H147,3)    /* "SP":"R" level
  3042. endfunc
  3043. func PC_G_P()
  3044.     TSP(148,116,pc_g)
  3045.     sp_scrl(106,173+(pc_g shl 1),128,&H147,3)    /* "SP":"G" level
  3046. endfunc
  3047. func PC_B_P()
  3048.     TSP(148,124,pc_b)
  3049.     sp_scrl(107,173+(pc_b shl 1),136,&H147,3)    /* "SP":"B" level
  3050. endfunc
  3051.  
  3052. /*[E]= -: Pen Color Change :- ====
  3053. /*====------------------------====
  3054. func PC_CHANGE()
  3055.     wk0=(pc_g shl 11)+(pc_r shl 6)+(pc_b shl 1)
  3056.  
  3057.     palet( 24+(pen_c shl 1),wk0)
  3058.     palet( 25+(pen_c shl 1),wk0)
  3059.  
  3060.     edit_palet(pen_c)=wk0
  3061.  
  3062.     sp_col2( 7,edit_palet(pen_c), 1)
  3063. endfunc
  3064.  
  3065. /*[E]= -: Edit Palet Defalt :- ====
  3066. /*====-------------------------====
  3067. func EDIT_PAL_DEF()
  3068.     play_se(3)
  3069.     for i=0 to 7
  3070.         palet( 24+(i shl 1),edit_palet_def(i))
  3071.         palet( 25+(i shl 1),edit_palet_def(i))
  3072.  
  3073.         edit_palet(i)=edit_palet_def(i)
  3074.     next
  3075.  
  3076.     PEN_C_SEL()
  3077. endfunc
  3078.  
  3079. /*[E]= -: Hint Check :- ====
  3080. /*====------------------====
  3081. func HINT_CHECK()
  3082.     for i=0 to 329
  3083.         hint_x(i)=&HFF
  3084.         hint_y(i)=&HFF
  3085.     next
  3086. /*---- -: タテ ノ ヒント ノ チェック :- ----
  3087.     tfill( 73,  3,252, 68, 0)
  3088.     tfill(228,196,251,203, 0)
  3089.     h_err=0
  3090.     hwk0=0                    /* check line
  3091.     while hwk0<>xsize
  3092.         if g_mode = 1 then {        /* "edit" x-line cursole put
  3093.             sp_scrl(117,hwk0*6+ 84, 79,&H142,3)    /* "SP":cs(y)
  3094.             sp_out()
  3095.         }
  3096.  
  3097.         for i=0 to 10            /* buffer clear
  3098.             hint_buff(i)=&HFF
  3099.         next
  3100.         h_head=0
  3101.         hwk1=ysize-1
  3102.         h_bit(0)=edit_map(hwk0+hwk1*30) and 1
  3103.         if h_bit(0) = 1 then hwk2=1 else hwk2=0        /* hwk2 = レンゾクカイスウ
  3104.         hwk1=hwk1-1
  3105.         while 1
  3106.             h_bit(1)=edit_map(hwk0+hwk1*30) and 1
  3107.             if h_bit(1) = 0 then {
  3108.                 if h_bit(0) = 1 then {
  3109.                     hint_buff(h_head)=hwk2
  3110.                     h_head=h_head+1
  3111.                 }
  3112.                 hwk1=hwk1-1
  3113.             } else {
  3114.                 if h_bit(0) <> h_bit(1) then {
  3115.                     if h_head = 11 then {
  3116.                         h_err=1
  3117.                         break
  3118.                     }
  3119.                     hwk2=1
  3120.                     hwk1=hwk1-1
  3121.                 } else {
  3122.                     hwk2=hwk2+1
  3123.                     hwk1=hwk1-1
  3124.                 }
  3125.             }
  3126.             h_bit(0)=h_bit(1)
  3127.  
  3128.             if hwk1 = &HFF then {
  3129.                 if h_bit(1) = 1 then hint_buff(h_head)=hwk2
  3130.                 break
  3131.             }
  3132.         endwhile
  3133.  
  3134.         if h_err = 0 then {
  3135.             HINT_P1(hwk0)
  3136.             if g_mode = 0 then {    /* "play" hint_buff save
  3137.                 for i=0 to 10
  3138.                     hint_y(hwk0*11+i)=hint_buff(i)
  3139.                 next
  3140.             }
  3141.         } else {
  3142.             break
  3143.         }
  3144.  
  3145.         hwk0=hwk0+1
  3146.     endwhile
  3147.     if g_mode = 1 then {            /* "edit" OK/ER put
  3148.         if h_err = 1 then {
  3149.             play_se(6)
  3150.             TFP(220,196,"Xc")
  3151.             return()
  3152.         } else {
  3153.             TFP(220,196,"Xb")
  3154.             sp_scrl(117,0,0,0,0)
  3155.             sp_out()
  3156.         }
  3157.     }
  3158.  
  3159. /*---- -: ヨコ ノ ヒント ノ チェック :- ----
  3160.     tfill(  3, 73, 68,252, 0)
  3161.     hwk0=0                    /* シラベル ライン
  3162.     while hwk0<>ysize
  3163.         if g_mode = 1 then {        /* "edit" y-line cursole put
  3164.             sp_scrl(118, 79,hwk0*6+ 84,&H143,3)    /* "SP":cs(x)
  3165.             sp_out()
  3166.         }
  3167.  
  3168.         for i=0 to 10            /* buffer clear
  3169.             hint_buff(i)=&HFF
  3170.         next
  3171.         h_head=0
  3172.         hwk1=xsize-1
  3173.         h_bit(0)=edit_map(hwk0*30+hwk1) and 1
  3174.         if h_bit(0) = 1 then hwk2=1 else hwk2=0        /* hwk2 = レンゾクカイスウ
  3175.         hwk1=hwk1-1
  3176.         while 1
  3177.             h_bit(1)=edit_map(hwk0*30+hwk1) and 1
  3178.             if h_bit(1) = 0 then {
  3179.                 if h_bit(0) = 1 then {
  3180.                     hint_buff(h_head)=hwk2
  3181.                     h_head=h_head+1
  3182.                 }
  3183.                 hwk1=hwk1-1
  3184.             } else {
  3185.                 if h_bit(0) <> h_bit(1) then {
  3186.                     if h_head = 11 then {
  3187.                         h_err=1
  3188.                         break
  3189.                     }
  3190.                     hwk2=1
  3191.                     hwk1=hwk1-1
  3192.                 } else {
  3193.                     hwk2=hwk2+1
  3194.                     hwk1=hwk1-1
  3195.                 }
  3196.             }
  3197.             h_bit(0)=h_bit(1)
  3198.  
  3199.             if hwk1 = &HFF then {
  3200.                 if h_bit(1) = 1 then hint_buff(h_head)=hwk2
  3201.                 break
  3202.             }
  3203.         endwhile
  3204.  
  3205.         if h_err = 0 then {
  3206.             HINT_P2(hwk0)
  3207.             if g_mode = 0 then {    /* "play" hint_buff save
  3208.                 for i=0 to 10
  3209.                     hint_x(hwk0*11+i)=hint_buff(i)
  3210.                 next
  3211.             }
  3212.         } else {
  3213.             break
  3214.         }
  3215.  
  3216.         hwk0=hwk0+1
  3217.     endwhile
  3218.     if g_mode = 1 then {            /* "edit" OK/ER put
  3219.         if h_err=1 then {
  3220.             play_se(6)
  3221.             TFP(236,196,"Yc")
  3222.             return()
  3223.         } else {
  3224.             TFP(236,196,"Yb")
  3225.             sp_scrl(118,0,0,0,0)
  3226.             sp_out()
  3227.         }
  3228.     }
  3229. endfunc
  3230.  
  3231. /*[E]= -: Hint Display :- ====
  3232. /*====--------------------====
  3233. func HINT_P1(x;char)
  3234.     wk0=0
  3235.     while wk0 <> 11
  3236.         wk1=hint_buff(wk0)
  3237.         if wk1 <> &HFF then {
  3238.             sp_pat(wk1,wk9,0)
  3239.             tput(x*6+ 73,63-wk0*6,6,6,wk9,"pset")
  3240.             wk0=wk0+1
  3241.         } else {
  3242.             break
  3243.         }
  3244.     endwhile
  3245.     if wk0 = 0 then {
  3246.         sp_pat(&H00,wk9,0)
  3247.         tput(x*6+ 73, 63,6,6,wk9,"pset")
  3248.         hint_buff(0)=&H00
  3249.     }
  3250. endfunc
  3251. func HINT_P2(y;char)
  3252.     wk0=0
  3253.     while wk0 <> 11
  3254.         wk1=hint_buff(wk0)
  3255.         if wk1 <> &HFF then {
  3256.             sp_pat(wk1,wk9,0)
  3257.             tput(63-wk0*6,y*6+ 73,6,6,wk9,"pset")
  3258.             wk0=wk0+1
  3259.         } else {
  3260.             break
  3261.         }
  3262.     endwhile
  3263.     if wk0 = 0 then {
  3264.         sp_pat(&H00,wk9,0)
  3265.         tput( 63,y*6+ 73,6,6,wk9,"pset")
  3266.         hint_buff(0)=&H00
  3267.     }
  3268. endfunc
  3269.  
  3270. /*[E]= -: Edit Screen Fill :- ====
  3271. /*====------------------------====
  3272. func EDIT_FILL()
  3273.     play_se(3)
  3274.     if pen_mode = 0 then {
  3275.         for i=0 to ysize-1
  3276.         for j=0 to xsize-1
  3277.             wk0=edit_map(i*30+j)
  3278.  
  3279.             COL_BLK_P(flbt,(wk0 shr 1),j,i)
  3280.  
  3281.             edit_map(i*30+j)=(wk0 and 14)+flbt
  3282.         next
  3283.         next
  3284.     } else {
  3285.         for i=0 to ysize-1
  3286.         for j=0 to xsize-1
  3287.             wk0=edit_map(i*30+j)
  3288.  
  3289.             COL_BLK_P((wk0 and 1),pen_c,j,i)
  3290.  
  3291.             edit_map(i*30+j)=(pen_c shl 1)+(wk0 and 1)
  3292.         next
  3293.         next
  3294.     }
  3295.  
  3296.     PRS_BT(100,236,236)
  3297. endfunc
  3298.  
  3299. /*[E]= -: Edit All Init. :- ====
  3300. /*====----------------------====
  3301. func EDIT_ALL_INIT(fl;char)
  3302.     if fl = 1 then play_se(3)
  3303.     xsize=5                    /* x/y size init.
  3304.     ysize=5
  3305.     if fl = 1 then {
  3306.         TSP(196,164,xsize)
  3307.         TSP(196,172,ysize)
  3308.         TSP( 48, 40,xsize)
  3309.         TSP( 48, 48,ysize)
  3310.     }
  3311.  
  3312.     for i=0 to 15                /* stage title init.
  3313.         stg_name(i)=&HFF
  3314.     next
  3315.     for i=0 to 11
  3316.         wk0=stg_name(i)
  3317.         TFP2(i*20+ 14,268,wk0)
  3318.     next
  3319.  
  3320.     for i=0 to 7                /* stage palet init.
  3321.         edit_palet(i)=edit_palet_def(i)
  3322.         palet( 24+(i shl 1),edit_palet_def(i))
  3323.         palet( 25+(i shl 1),edit_palet_def(i))
  3324.     next
  3325.     if fl = 1 then {
  3326.         PEN_C_SEL()
  3327.         sp_out()
  3328.     }
  3329.  
  3330.     for i=0 to 899                /* stage data init.
  3331.         edit_map(i)=&H00
  3332.     next
  3333.     if fl = 1 then {
  3334.         apage(0)
  3335.         fill(  5,  5, 34, 34,  0)
  3336.         fill( 39,  5, 68, 34,  0)
  3337.         EDIT_DIS()
  3338.         PRS_BT(100,236,236)
  3339.     }
  3340. endfunc
  3341.  
  3342. /*[E]= -: X Size Change :- ====
  3343. /*====---------------------====
  3344. func XSIZE_C()
  3345.     if ST1 = 4 then {
  3346.         for i=0 to 5
  3347.             apage(1)
  3348.             put(xsize*6+ 73,i*30+ 73,xsize*6+102,i*30+102,PEK)
  3349.             apage(0)
  3350.             fill(xsize+  5,i*5+  5,xsize+  9,i*5+  9,  0)
  3351.             fill(xsize+ 39,i*5+  5,xsize+ 43,i*5+  9,  0)
  3352.         next
  3353.  
  3354. /*>>>> サイズ ヲ カエタトキニ ショキカスル <<<<
  3355. /* コノシタ 5ギョウ ヲ rem ニ スルト ショキカシナクナル
  3356.         for i=0 to ysize-1
  3357.         for j=0 to 4
  3358.             edit_map(xsize+i*30+j)=&H00
  3359.         next
  3360.         next
  3361.     } else {
  3362.         for i=0 to ysize/5-1
  3363.             apage(1)
  3364.             put(43+xsize*6,73+i*30,72+xsize*6,102+i*30,wkA)
  3365.             apage(0)
  3366.             fill(xsize    ,i*5+  5,xsize+  4,i*5+  9,  0)
  3367.             fill(xsize+ 34,i*5+  5,xsize+ 38,i*5+  9, 24)
  3368.         next
  3369.     }
  3370. endfunc
  3371.  
  3372. /*[E]= -: Y Size Change :- ====
  3373. /*====---------------------====
  3374. func YSIZE_C()
  3375.     if ST1 = 4 then {
  3376.         for i=0 to 5
  3377.             apage(1)
  3378.             put(i*30+ 73,ysize*6+ 73,i*30+102,ysize*6+102,PEK)
  3379.             apage(0)
  3380.             fill(i*5+  5,ysize+  5,i*5+  9,ysize+  9,  0)
  3381.             fill(i*5+ 39,ysize+  5,i*5+ 43,ysize+  9,  0)
  3382.         next
  3383.  
  3384. /*>>>> サイズ ヲ カエタトキニ ショキカスル <<<<
  3385. /* コノシタ 5ギョウ ヲ rem ニ スルト ショキカシナクナル
  3386.         for i=0 to 4
  3387.         for j=0 to xsize-1
  3388.             edit_map(ysize*30+i*30+j)=&H00
  3389.         next
  3390.         next
  3391.     } else {
  3392.         for i=0 to xsize/5-1
  3393.             apage(1)
  3394.             put(73+i*30,43+ysize*6,102+i*30,72+ysize*6,wkA)
  3395.             apage(0)
  3396.             fill(i*5+  5,ysize,i*5+  9,ysize+  4,  0)
  3397.             fill(i*5+ 39,ysize,i*5+ 43,ysize+  4, 24)
  3398.         next
  3399.     }
  3400. endfunc
  3401.  
  3402. /*[E]= -: Stage Title Input :- ====
  3403. /*====-------------------------====
  3404. func STG_TIT_IN()
  3405.     play_se(3)
  3406.     TX_DISP(0) : vpage(0) : sp_disp(0)
  3407.     home(0,  0,256) : home(1,  0,256)
  3408.  
  3409.     ni_x=0
  3410.     ni_y=0
  3411.     n_head=0
  3412.     sp_scrl(104,ni_x*12+ 26,(ni_y shl 4)+ 60,&H14C,3)    /* "SP":sel font
  3413.     sp_scrl(105,n_head*20+ 20, 18,&H144,3)            /* "SP":input head
  3414.     sp_scrl(106,n_head*20+ 20, 38,&H8144,3)
  3415.     sp_scrl(107,n_head*20+ 32, 18,&H4144,3)
  3416.     sp_scrl(108,n_head*20+ 32, 38,&HC144,3)
  3417.     sp_scrl(117,0,0,0,0)
  3418.     sp_scrl(118,0,0,0,0)
  3419.     sp_out()
  3420.  
  3421.     vpage(3) : sp_disp(1) : TX_DISP(1)
  3422.     thome(  0,256)
  3423.  
  3424. /*---- -: Stage Title Input Main :- ----
  3425.     kb_cls()
  3426.     ston=&HFF
  3427.     sths=&HFF
  3428.     bton=kstrig(1)
  3429.     while 1
  3430.         ST_INP()
  3431.  
  3432.         if kyb = &H1B then break    /* ret. to title
  3433.  
  3434. /*---- -: カーソル ピコピコ :- ----
  3435.         piko(0)=piko(0)+1 and 3
  3436.         if piko(0) = 0 then {
  3437.             piko(1)=piko(1)+1 and 3
  3438.         }
  3439.  
  3440. /*++++ -: カーソル イドウ :- ++++
  3441.         cxn=ni_x
  3442.         cyn=ni_y
  3443.  
  3444.         if ST1 <> 0 and sths = ST1 then {
  3445.         if ston = 0 then {
  3446.             ni_x=ni_x+mvof(ST1)
  3447.             ni_y=ni_y+mvof(ST1+10)
  3448.  
  3449.             if ni_x = &HFF then ni_x=19
  3450.             if ni_x = 20 then ni_x=0
  3451.  
  3452.             if ni_y = &HFF then ni_y=12
  3453.             if ni_y = 13 then ni_y=0
  3454.  
  3455.             if ni_x <> cxn or ni_y <> cyn then {
  3456.                 play_se(1)
  3457.             }
  3458.         }
  3459.         }
  3460.         sp_scrl(104,ni_x*12+ 30-piko(1),(ni_y shl 4)+ 64-piko(1),&H14C,3)    /* "SP":オテテ
  3461.  
  3462. /*++++ -: "A" ボタン ガ オサレタトキ :- ++++
  3463.         if bton = 0 and BT1 = 1 then {
  3464.             play_se(3)
  3465.             wk0=ni_y*20+ni_x
  3466.  
  3467.             if wk0 <= 255 then {
  3468.                 stg_name(n_head)=fnt_l(wk0)
  3469.                 TFP2(n_head*20+ 14,268,fnt_l(wk0))
  3470.                 n_head=n_head+1
  3471.                 if n_head = 12 then n_head=0
  3472.             }
  3473.             if wk0 = 256 then {        /* cursole left
  3474.                 n_head=n_head-1
  3475.                 if n_head = &HFF then n_head=11
  3476.             }
  3477.             if wk0 = 257 then {        /* cursole right
  3478.                 n_head=n_head+1
  3479.                 if n_head = 12 then n_head=0
  3480.             }
  3481.             if wk0 = 258 then {        /* back space
  3482.                 stg_name(n_head)=255
  3483.                 TFP2(n_head*20+ 14,268,255)
  3484.                 n_head=n_head-1
  3485.                 if n_head = &HFF then n_head=11
  3486.             }
  3487.             if wk0 = 259 then {        /* input exit
  3488.                 break
  3489.             }
  3490.  
  3491.             sp_scrl(105,n_head*20+ 20, 18,&H144,3)    /* "SP":input head
  3492.             sp_scrl(106,n_head*20+ 20, 38,&H8144,3)
  3493.             sp_scrl(107,n_head*20+ 32, 18,&H4144,3)
  3494.             sp_scrl(108,n_head*20+ 32, 38,&HC144,3)
  3495.  
  3496.             bton=BT1
  3497.         }
  3498.  
  3499. /*++++ -: "B" ボタン ガ オサレタトキ :- ++++
  3500.         if bton = 0 and BT1 = 2 then {
  3501.             play_se(2)
  3502.             stg_name(n_head)=255
  3503.             TFP2(n_head*20+ 14,268,255)
  3504.             n_head=n_head-1
  3505.             if n_head = &HFF then n_head=11
  3506.  
  3507.             sp_scrl(105,n_head*20+ 20, 18,&H144,3)    /* "SP":input head
  3508.             sp_scrl(106,n_head*20+ 20, 38,&H8144,3)
  3509.             sp_scrl(107,n_head*20+ 32, 18,&H4144,3)
  3510.             sp_scrl(108,n_head*20+ 32, 38,&HC144,3)
  3511.  
  3512.             bton=BT1
  3513.         }
  3514.  
  3515. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  3516.         ST_CK2(16,3)
  3517.  
  3518. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  3519.         if bton <> BT1 then bton=0
  3520.  
  3521.         sp_out()
  3522.     endwhile
  3523.  
  3524.     TX_DISP(0) : vpage(0) : sp_disp(0)
  3525.     home(0,  0,  0) : home(1,  0,  0)
  3526.     sp_scrl(104,200+(pen_c shl 3),112,&H146,3)    /* "SP":select color
  3527.     sp_scrl(105,173+(pc_r shl 1),120,&H147,3)    /* "SP":"R" level
  3528.     sp_scrl(106,173+(pc_g shl 1),128,&H147,3)    /* "SP":"G" level
  3529.     sp_scrl(107,173+(pc_b shl 1),136,&H147,3)    /* "SP":"B" level
  3530.     sp_scrl(108,0,0,0,0)
  3531.     sp_out()
  3532.     vpage(3) : sp_disp(1) : TX_DISP(1)
  3533. endfunc
  3534.  
  3535. /*[E]= -: Edit Data Save :- ====
  3536. /*====----------------------====
  3537. func EDIT_SAVE(fl;char)
  3538.     if fl = 1 then play_se(3)
  3539. /*-: size data save :-
  3540.     user_data((stage shl 9)  )=xsize
  3541.     user_data((stage shl 9)+1)=ysize
  3542. /*-: stage title save :-
  3543.     for i=0 to 15
  3544.         user_data((stage shl 9)+ 2+i)=stg_name(i)
  3545.     next
  3546. /*-: stage palet save :-
  3547.     for i=0 to 7
  3548.         wk0=edit_palet(i)
  3549.  
  3550.         user_data((stage shl 9)+18+(i shl 1))=wk0 shr 8
  3551.         user_data((stage shl 9)+19+(i shl 1))=wk0 and 255
  3552.     next
  3553. /*-: clear flag init. :-
  3554.     user_data((stage shl 9)+34)=0
  3555. /*                    ^ プロテクト ヲ カケルトキ ハ "2" ニ スル
  3556. /*-: try count init. :-
  3557.     user_data((stage shl 9)+35)=0
  3558. /*-: record init. :-
  3559.     user_data((stage shl 9)+36)=&H00
  3560.     user_data((stage shl 9)+37)=&H05
  3561.     user_data((stage shl 9)+38)=&H7E
  3562.     user_data((stage shl 9)+39)=&H3F
  3563. /*-: stage data save :-
  3564.     if fl = 1 then {
  3565.         for i=0 to 449
  3566.             wk0=edit_map((i shl 1)  )
  3567.             wk1=edit_map((i shl 1)+1)
  3568.  
  3569.             user_data((stage shl 9)+62+i)=(wk0 shl 4)+wk1
  3570.         next
  3571.     } else {
  3572.         for i=0 to 449
  3573.             user_data((stage shl 9)+62+i)=&H00
  3574.         next
  3575.     }
  3576.  
  3577.     if fl = 1 then PRS_BT(100,236,236)
  3578. endfunc
  3579.  
  3580. /*[E]= -: Edit Data Load :- ====
  3581. /*====----------------------====
  3582. func EDIT_LOAD()
  3583. /*---- -: check :- ----
  3584. /*-: プロテクト :-
  3585.     if (user_data((stage shl 9)+ 34) and 2) = 2 then {
  3586.         play_se(6)
  3587.         return()
  3588.     }
  3589. /*-: データ ミトウロク :-
  3590.     if user_data((stage shl 9)) = 0 then {
  3591.         play_se(6)
  3592.         return()
  3593.     }
  3594.  
  3595.     play_se(3)
  3596.     apage(0)
  3597.     fill(  5,  5, 34, 34,  0)        /* sample clear
  3598.     fill( 39,  5, 68, 34,  0)
  3599. /*-: size data load :-
  3600.     xsize=user_data((stage shl 9)  )
  3601.     ysize=user_data((stage shl 9)+1)
  3602.     TSP(196,164,xsize)
  3603.     TSP(196,172,ysize)
  3604.     TSP( 48, 40,xsize)
  3605.     TSP( 48, 48,ysize)
  3606. /*-: stage title load :-
  3607.     for i=0 to 15
  3608.         stg_name(i)=user_data((stage shl 9)+ 2+i)
  3609.     next
  3610.     for i=0 to 11
  3611.         wk0=stg_name(i)
  3612.         TFP2(i*20+ 14,268,wk0)
  3613.     next
  3614. /*-: stage palet load :-
  3615.     for i=0 to 7
  3616.         wk0=user_data((stage shl 9)+18+(i shl 1))
  3617.         wk1=user_data((stage shl 9)+19+(i shl 1))
  3618.  
  3619.         edit_palet(i)=(wk0 shl 8)+wk1
  3620.  
  3621.         palet( 24+(i shl 1),edit_palet(i))
  3622.         palet( 25+(i shl 1),edit_palet(i))
  3623.     next
  3624.     PEN_C_SEL()
  3625. /*-: stage data load :-
  3626.     for i=0 to 449
  3627.         wk0=user_data((stage shl 9)+62+i)
  3628.  
  3629.         edit_map((i shl 1)  )=wk0 shr 4
  3630.         edit_map((i shl 1)+1)=wk0 and 15
  3631.     next
  3632.     EDIT_DIS()
  3633.  
  3634.     PRS_BT(100,236,236)
  3635. endfunc
  3636.  
  3637. /*[E]= -: User Data Save :- ====
  3638. /*====----------------------====
  3639. func DATA_SAVE()
  3640.     if dskok = 0 then {
  3641.         play_se(6)
  3642.         return()
  3643.     }
  3644.     play_se(3)
  3645.     wk0=fopen("PX_USR  .DAT","c")
  3646.     fwrite(user_data,51200,wk0)
  3647.     fclose(wk0)
  3648.  
  3649.     PRS_BT(100,236,236)
  3650. endfunc
  3651.  
  3652. /*[E]= -: User Data Load :- ====
  3653. /*====----------------------====
  3654. func DATA_LOAD()
  3655.     wk0=filesnum("PX_USR  .DAT",&H20)
  3656.     if wk0 = 0 then {
  3657.         play_se(6)
  3658.         return()
  3659.     }
  3660.  
  3661.     play_se(3)
  3662.     wk0=fopen("PX_USR  .DAT","r")
  3663.     fread(user_data,51200,wk0)
  3664.     fclose(wk0)
  3665.  
  3666.     PRS_BT(100,236,236)
  3667. endfunc
  3668.  
  3669. /*[E]= -: Edit Data Shift :- ====
  3670. /*====-----------------------====
  3671. func SHIFT()
  3672.     play_se(3)
  3673. /*-: shift up :-
  3674.     if shf = 0 then {
  3675.         for i=0 to xsize-1
  3676.             wk0=edit_map(i)
  3677.             for j=1 to ysize-1
  3678.                 wk1=edit_map(j*30+i)
  3679.                 edit_map((j-1)*30+i)=wk1
  3680.             next
  3681.             edit_map((ysize-1)*30+i)=wk0
  3682.         next
  3683.     }
  3684.  
  3685. /*-: shift down :-
  3686.     if shf = 1 then {
  3687.         for i=0 to xsize-1
  3688.             wk0=edit_map(i)
  3689.             for j=1 to ysize-1
  3690.                 wk1=edit_map(j*30+i)
  3691.                 edit_map(j*30+i)=wk0
  3692.                 wk0=wk1
  3693.             next
  3694.             edit_map(i)=wk0
  3695.         next
  3696.     }
  3697.  
  3698. /*-: shift left :-
  3699.     if shf = 2 then {
  3700.         for i=0 to ysize-1
  3701.             wk0=edit_map(i*30  )
  3702.             for j=1 to xsize-1
  3703.                 wk1=edit_map(i*30+j)
  3704.                 edit_map(i*30+(j-1))=wk1
  3705.             next
  3706.             edit_map(i*30+(xsize-1))=wk0
  3707.         next
  3708.     }
  3709.  
  3710. /*-: shift right :-
  3711.     if shf = 3 then {
  3712.         for i=0 to ysize-1
  3713.             wk0=edit_map(i*30)
  3714.             for j=1 to xsize-1
  3715.                 wk1=edit_map(i*30+j)
  3716.                 edit_map(i*30+j)=wk0
  3717.                 wk0=wk1
  3718.             next
  3719.             edit_map(i*30)=wk0
  3720.         next
  3721.     }
  3722.     EDIT_DIS()
  3723. endfunc
  3724.  
  3725. /*[E]= -: Edit Data Swap :- ====
  3726. /*====----------------------====
  3727. func SWAP()
  3728.     play_se(3)
  3729. /*-:- swp_s0 change -:-
  3730.     TSP3(176,156,swp_s0+1)
  3731.     SWAP_S1(0)
  3732.     if BT1 = 2 then {
  3733.         TFP(176,156,"_______")
  3734.         return()
  3735.     }
  3736. /*-:- swp_s1 change -:-
  3737.     TFP(200,156,"^")
  3738.     TSP3(208,156,swp_s1+1)
  3739.     SWAP_S1(1)
  3740.     if BT1 = 2 then {
  3741.         TFP(176,156,"_______")
  3742.         return()
  3743.     }
  3744.  
  3745. /*---- -: data swap :- ----
  3746.     for i=0 to 511
  3747.         wk0=user_data((swp_s0 shl 9)+i)
  3748.         wk1=user_data((swp_s1 shl 9)+i)
  3749.  
  3750.         user_data((swp_s0 shl 9)+i)=wk1
  3751.         user_data((swp_s1 shl 9)+i)=wk0
  3752.     next
  3753.  
  3754.     PRS_BT(100,236,236)
  3755.     TFP(176,156,"_______")
  3756. endfunc
  3757. func SWAP_S1(fl;char)
  3758. /*---- -: swap main :- ----
  3759.     kb_cls()
  3760.     ston=&HFF
  3761.     sths=&HFF
  3762.     bton=kstrig(1)
  3763.     while 1
  3764.         ST_INP()
  3765.  
  3766. /*++++ -: swp_s0 change :- ++++
  3767.         wk3=swp_s0
  3768.         if ST1 <> 0 and sths = ST1 then {
  3769.         if ston = 0 then {
  3770.             play_se(1)
  3771.             if fl = 0 then {
  3772.                 swp_s0=swp_s0+mvof(ST1)
  3773.                 if swp_s0 = &HFF then swp_s0=99
  3774.                 if swp_s0 = 100 then swp_s0=0
  3775.  
  3776.                 TSP3(176,156,swp_s0+1)
  3777.             }
  3778.             if fl = 1 then {
  3779.                 swp_s1=swp_s1+mvof(ST1)
  3780.                 if swp_s1 = &HFF then swp_s1=99
  3781.                 if swp_s1 = 100 then swp_s1=0
  3782.  
  3783.                 TSP3(208,156,swp_s1+1)
  3784.             }
  3785.         }
  3786.         }
  3787.  
  3788. /*++++ -: "A"ボタン ガ オサレタトキ :- ++++
  3789.         if BT1 = 1 then {
  3790.         if bton = 0 then {
  3791.             play_se(3)
  3792.             bton=BT1
  3793.             break
  3794.         }
  3795.         }
  3796.  
  3797. /*++++ -: "B"ボタン ガ オサレタトキ :- ++++
  3798.         if BT1 = 2 then {
  3799.         if bton = 0 then {
  3800.             play_se(2)
  3801.             bton=BT1
  3802.             break
  3803.         }
  3804.         }
  3805.  
  3806. /*++++ -: スティック ノ ニュウリョク アトショリ :- ++++
  3807.         ST_CK2(16,2)
  3808.  
  3809. /*++++ -: ボタン ノ ニュウリョク アトショリ :- ++++
  3810.         if bton <> BT1 then bton=0
  3811.  
  3812.         v_disp()
  3813.     endwhile
  3814. endfunc
  3815.  
  3816. /*[E]= -: Edit Data BIT XOR :- ====
  3817. /*====-------------------------====
  3818. func EDIT_XOR()
  3819.     play_se(3)
  3820.     for i=0 to ysize-1
  3821.     for j=0 to xsize-1
  3822.         wk0=edit_map(i*30+j) xor 1
  3823.  
  3824.         COL_BLK_P((wk0 and 1),(wk0 shr 1),j,i)
  3825.  
  3826.         edit_map(i*30+j)=wk0
  3827.     next
  3828.     next
  3829. endfunc
  3830.  
  3831. /*[E]= -: Edit Data Mirror :- ====
  3832. /*====------------------------====
  3833. func MIRROR()
  3834.     dim char lp(6)={0,1,4,6,9,11,14}
  3835.     play_se(3)
  3836.     if mir = 0 then {
  3837. /*---- -: ジョウゲ ハンテン :- ----
  3838.         for i=0 to lp(ysize/5)
  3839.         for j=0 to xsize-1
  3840.             wk0=edit_map(i*30+j)
  3841.             wk1=edit_map((ysize*30-30)-i*30+j)
  3842.             edit_map(i*30+j)=wk1
  3843.             edit_map((ysize*30-30)-i*30+j)=wk0
  3844.         next
  3845.         next
  3846.     } else {
  3847. /*---- -: サユウ ハンテン :- ----
  3848.         for i=0 to lp(xsize/5)
  3849.         for j=0 to ysize-1
  3850.             wk0=edit_map(j*30+i)
  3851.             wk1=edit_map(j*30-i+xsize-1)
  3852.             edit_map(j*30+i)=wk1
  3853.             edit_map(j*30-i+xsize-1)=wk0
  3854.         next
  3855.         next
  3856.     }
  3857.  
  3858.     for i=0 to ysize-1
  3859.     for j=0 to xsize-1
  3860.         wk0=edit_map(i*30+j) and 1    /* bit
  3861.         wk1=edit_map(i*30+j) shr 1    /* color
  3862.  
  3863.         COL_BLK_P(wk0,wk1,j,i)
  3864.     next
  3865.     next
  3866. endfunc
  3867.  
  3868. /*[S]= -: Edit Data Display :- ====
  3869. /*====-------------------------====
  3870. func EDIT_DIS()
  3871.     apage(1)
  3872.     for i=0 to 5
  3873.     for j=0 to 5
  3874.         put(j*30+ 73,i*30+ 73,j*30+102,i*30+102,PEK)
  3875.     next
  3876.     next
  3877.  
  3878.     if g_mode <> 1 then {
  3879.         for i=0 to ysize-1
  3880.         for j=0 to xsize-1
  3881.             put(j*6+ 73,i*6+ 73,j*6+ 78,i*6+ 78,BLK0)
  3882.         next
  3883.         next
  3884.     } else {
  3885.         for i=0 to ysize-1
  3886.         for j=0 to xsize-1
  3887.             wk0=edit_map(i*30+j) and 1    /* bit
  3888.             wk1=edit_map(i*30+j) shr 1    /* color
  3889.  
  3890.             COL_BLK_P(wk0,wk1,j,i)
  3891.         next
  3892.         next
  3893.     }
  3894. endfunc
  3895.  
  3896. /*[G]= -: Normal Block Put :- ====
  3897. /*====------------------------====
  3898. func NML_BLK_P(fl;char)
  3899.     if BT1 = 1 then {
  3900.         wk0=flg_map(cy*30+cx)
  3901.         if wk0 <> 1 then {        /* マエノジョウタイガ ケズレテイナイトキ
  3902.             if flg_on_mode = 0 or flg_on_mode = 1 then {
  3903. /*---- -: hanmer anime 1st. :- ----
  3904.                 if fl+k8stick(1) = 0 then {
  3905.                     sp_scrl(100,cx_+102,cy_+ 74,&H152,3)    /* "SP":hanmer
  3906.                     sp_scrl(101,cx_+ 90,cy_+ 78,&H150,3)    /* "SP":pick'
  3907.                     sp_out()
  3908.                     sp_scrl(100,cx_+ 94,cy_+ 74,&H153,3)    /* "SP":hanmer
  3909.                     sp_scrl(101,cx_+ 89,cy_+ 79,&H150,3)    /* "SP":pick'
  3910.                     sp_out()
  3911.                     sp_scrl(100,cx_+ 94,cy_+ 74,&H153,3)    /* "SP":hanmer
  3912.                     sp_scrl(101,cx_+ 88,cy_+ 80,&H150,3)    /* "SP":pick'
  3913.                     sp_out()
  3914.                 }
  3915.  
  3916.                 play_se(4)
  3917.                 sp_scrl(100,cx_+ 94,cy_+ 74,&H153,3)    /* "SP":hanmer
  3918.                 sp_scrl(101,cx_+ 87,cy_+ 81,&H150,3)    /* "SP":pick'
  3919.                 sp_scrl(104,cx_+ 82,cy_+ 82,&H355,3)    /* "SP":spark
  3920.                 sp_scrl(105,cx_+ 86,cy_+ 86,&HC355,3)
  3921.                 sp_scrl(98,0,0,0,0)
  3922.                 sp_scrl(99,0,0,0,0)
  3923.                 sp_out()
  3924.  
  3925.                 apage(1)
  3926.                 put(cx_+ 73,cy_+ 73,cx_+ 78,cy_+ 78,BLK2)
  3927.                 pset(cx+  9,cy+  9, 12)
  3928.                 flg_map(cy*30+cx)=1
  3929.                 flg_on_mode=1
  3930.                 if fl = 0 then tim_c=tim_c+4
  3931.  
  3932.                 if (edit_map(cy*30+cx) and 1) = 0 then {
  3933.                     if pnlt = 1 then {
  3934.                     play_se(6)
  3935.                     if tim_c >=&H537F0 then {
  3936.                         g_mode=99    /* ゲーム オーバー
  3937.                         tim_c=&H57E3F
  3938.                     } else {
  3939.                         if dbg <> 1 then tim_c=tim_c+&H4650    /* マチガエタラ 5フン プラス
  3940.                     }
  3941.                     TIM_P1()
  3942.  
  3943.                     put(cx_+ 73,cy_+ 73,cx_+ 78,cy_+ 78,BLK1)
  3944.                     pset(cx+  9,cy+  9,  4)
  3945.                     flg_map(cy*30+cx)=2
  3946.                     } else {
  3947.                         stg_cmp=stg_cmp-1
  3948.                         if help_p < 100 and fl = 0 then {
  3949.                             help_p=help_p+1
  3950.                             if (help_p and 1) = 0 then HELP_DIS()
  3951.                         }
  3952.                     }
  3953.                 } else {
  3954.                     stg_cmp=stg_cmp+1
  3955.                     if help_p < 100 and fl = 0 then {
  3956.                         help_p=help_p+1
  3957.                         if (help_p and 1) = 0 then HELP_DIS()
  3958.                     }
  3959.                 }
  3960. /*---- -: hanmer anime 2nd. :- ----
  3961.                 sp_scrl(100,cx_+102,cy_+ 74,&H152,3)    /* "SP":hanmer
  3962.                 sp_scrl(101,cx_+ 88,cy_+ 80,&H150,3)    /* "SP":pick'
  3963.                 sp_scrl(104,cx_+ 82,cy_+ 82,&H354,3)    /* "SP":spark
  3964.                 sp_scrl(105,cx_+ 86,cy_+ 86,&HC354,3)
  3965.                 sp_out()
  3966.             } else {
  3967.                 sp_scrl(101,cx_+ 88,cy_+ 88,&H156,3)    /* "SP":コクバンケシ
  3968.                 sp_scrl(100,cx_+ 90,cy_+ 90,&H14C,3)    /* "SP":オテテ
  3969.                 tim_c=tim_c+1
  3970.             }
  3971.         } else {            /* マエノジョウタイガ ケズレテイタトキ
  3972.             if flg_on_mode = 0 or flg_on_mode = 2 then {
  3973.                 if k8stick(1) <> 0 then {
  3974.                     sp_scrl(101,cx_+ 86,cy_+ 90,&H156,3)    /* "SP":コクバンケシ
  3975.                     sp_scrl(100,cx_+ 88,cy_+ 92,&H14C,3)    /* "SP":オテテ
  3976.                     sp_scrl(104,cx_+ 76,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  3977.                     sp_scrl(105,cx_+ 88,cy_+ 76,&H414D,3)
  3978.                     sp_out()
  3979.                 } else {
  3980.                     sp_scrl(101,cx_+ 90,cy_+ 86,&H156,3)    /* "SP":コクバンケシ
  3981.                     sp_scrl(100,cx_+ 92,cy_+ 88,&H14C,3)    /* "SP":オテテ
  3982.                     sp_scrl(104,cx_+ 76,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  3983.                     sp_scrl(105,cx_+ 88,cy_+ 76,&H414D,3)
  3984.                     sp_out()
  3985.                     sp_scrl(101,cx_+ 86,cy_+ 90,&H156,3)    /* "SP":コクバンケシ
  3986.                     sp_scrl(100,cx_+ 88,cy_+ 92,&H14C,3)    /* "SP":オテテ
  3987.                     sp_scrl(104,cx_+ 75,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  3988.                     sp_scrl(105,cx_+ 88,cy_+ 75,&H414D,3)
  3989.                     sp_out()
  3990.                 }
  3991.  
  3992.                 play_se(8)
  3993.                 apage(1)
  3994.                 put(cx_+ 73,cy_+ 73,cx_+ 78,cy_+ 78,BLK0)
  3995.                 pset(cx+   9,cy+  9,  4)
  3996.                 flg_map(cy*30+cx)=0
  3997.                 flg_on_mode=2
  3998.                 tim_c=tim_c+4
  3999.  
  4000.                 if (edit_map(cy*30+cx) and 1) = 0 then {
  4001.                     stg_cmp=stg_cmp+1
  4002.                 } else {
  4003.                     stg_cmp=stg_cmp-1
  4004.                 }
  4005.  
  4006.                 if k8stick(1) = 0 then {
  4007.                     sp_scrl(101,cx_+ 89,cy_+ 87,&H156,3)    /* "SP":コクバンケシ
  4008.                     sp_scrl(100,cx_+ 91,cy_+ 89,&H14C,3)    /* "SP":オテテ
  4009.                     sp_scrl(104,cx_+ 74,cy_+ 88,&H14E,3)    /* "SP":ケムリ
  4010.                     sp_scrl(105,cx_+ 88,cy_+ 74,&H414E,3)
  4011.                     sp_out()
  4012.                     sp_scrl(101,cx_+ 87,cy_+ 89,&H156,3)    /* "SP":コクバンケシ
  4013.                     sp_scrl(100,cx_+ 89,cy_+ 91,&H14C,3)    /* "SP":オテテ
  4014.                     sp_scrl(104,cx_+ 73,cy_+ 88,&H14E,3)    /* "SP":ケムリ
  4015.                     sp_scrl(105,cx_+ 88,cy_+ 73,&H414E,3)
  4016.                     sp_out()
  4017.                 }
  4018.                 sp_scrl(101,cx_+ 88,cy_+ 88,&H156,3)    /* "SP":コクバンケシ
  4019.                 sp_scrl(100,cx_+ 90,cy_+ 90,&H14C,3)    /* "SP":オテテ
  4020.                 sp_scrl(104,cx_+ 72,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  4021.                 sp_scrl(105,cx_+ 88,cy_+ 72,&H414D,3)
  4022.                 sp_out()
  4023.             } else {
  4024.                 sp_scrl(100,cx_+102,cy_+ 74,&H152,3)    /* "SP":hanmer
  4025.                 tim_c=tim_c+1
  4026.             }
  4027.         }
  4028.     }
  4029.  
  4030.  
  4031.     if BT1 = 2 then {
  4032.         wk0=flg_map(cy*30+cx)
  4033.         if wk0 <> 2 then {        /* マエノジョウタイガ チェック サレテイナイトキ
  4034.             if flg_on_mode = 0 or flg_on_mode = 1 then {
  4035.                 if k8stick(1) <> 0 then {
  4036.                     sp_scrl(101,cx_+ 86,cy_+ 82,&H150,3)    /* "SP":pick'
  4037.                     sp_out()
  4038.                 } else {
  4039.                     sp_scrl(101,cx_+ 89,cy_+ 79,&H150,3)    /* "SP":pick'
  4040.                     sp_out()
  4041.                     sp_scrl(101,cx_+ 86,cy_+ 82,&H150,3)    /* "SP":pick'
  4042.                     sp_out()
  4043.                 }
  4044.  
  4045.                 play_se(5)
  4046.                 apage(1)
  4047.                 put(cx_+ 73,cy_+ 73,cx_+ 78,cy_+ 78,BLK1)
  4048.                 pset(cx+  9,cy+  9,  6)
  4049.                 if flg_map(cy*30+cx) = 1 then {
  4050.                     if (edit_map(cy*30+cx) and 1) = 0 then {
  4051.                         stg_cmp=stg_cmp+1
  4052.                     } else {
  4053.                         stg_cmp=stg_cmp-1
  4054.                     }
  4055.                 }
  4056.                 flg_map(cy*30+cx)=2
  4057.                 flg_on_mode=1
  4058.                 tim_c=tim_c+4
  4059.  
  4060.                 if k8stick(1) = 0 then {
  4061.                     sp_scrl(101,cx_+ 86,cy_+ 79,&H150,3)    /* "SP":pick'
  4062.                     sp_out()
  4063.                     sp_scrl(101,cx_+ 89,cy_+ 82,&H150,3)    /* "SP":pick'
  4064.                     sp_out()
  4065.                 }
  4066.                 sp_scrl(101,cx_+ 88,cy_+ 80,&H150,3)    /* "SP":pick'
  4067.             } else {
  4068.                 sp_scrl(101,cx_+ 88,cy_+ 88,&H156,3)    /* "SP":コクバンケシ
  4069.                 sp_scrl(100,cx_+ 90,cy_+ 90,&H14C,3)    /* "SP":オテテ
  4070.                 tim_c=tim_c+1
  4071.             }
  4072.         } else {            /* マエノジョウタイガ チェック サレテイタトキ
  4073.             if flg_on_mode = 0 or flg_on_mode = 2 then {
  4074.                 if k8stick(1) <> 0 then {
  4075.                     sp_scrl(101,cx_+ 86,cy_+ 90,&H156,3)    /* "SP":コクバンケシ
  4076.                     sp_scrl(100,cx_+ 88,cy_+ 92,&H14C,3)    /* "SP":オテテ
  4077.                     sp_scrl(104,cx_+ 76,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  4078.                     sp_scrl(105,cx_+ 88,cy_+ 76,&H414D,3)
  4079.                     sp_out()
  4080.                 } else {
  4081.                     sp_scrl(101,cx_+ 90,cy_+ 86,&H156,3)    /* "SP":コクバンケシ
  4082.                     sp_scrl(100,cx_+ 92,cy_+ 88,&H14C,3)    /* "SP":オテテ
  4083.                     sp_scrl(104,cx_+ 76,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  4084.                     sp_scrl(105,cx_+ 88,cy_+ 76,&H414D,3)
  4085.                     sp_out()
  4086.                     sp_scrl(101,cx_+ 86,cy_+ 90,&H156,3)    /* "SP":コクバンケシ
  4087.                     sp_scrl(100,cx_+ 88,cy_+ 92,&H14C,3)    /* "SP":オテテ
  4088.                     sp_scrl(104,cx_+ 75,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  4089.                     sp_scrl(105,cx_+ 88,cy_+ 75,&H414D,3)
  4090.                     sp_out()
  4091.                 }
  4092.  
  4093.                 play_se(8)
  4094.                 apage(1)
  4095.                 put(cx_+ 73,cy_+ 73,cx_+ 78,cy_+ 78,BLK0)
  4096.                 pset(cx+  9,cy+  9,  4)
  4097.                 flg_map(cy*30+cx)=0
  4098.                 flg_on_mode=2
  4099.                 tim_c=tim_c+4
  4100.  
  4101.                 if k8stick(1) = 0 then {
  4102.                     sp_scrl(101,cx_+ 89,cy_+ 87,&H156,3)    /* "SP":コクバンケシ
  4103.                     sp_scrl(100,cx_+ 91,cy_+ 89,&H14C,3)    /* "SP":オテテ
  4104.                     sp_scrl(104,cx_+ 74,cy_+ 88,&H14E,3)    /* "SP":ケムリ
  4105.                     sp_scrl(105,cx_+ 88,cy_+ 74,&H414E,3)
  4106.                     sp_out()
  4107.                     sp_scrl(101,cx_+ 87,cy_+ 89,&H156,3)    /* "SP":コクバンケシ
  4108.                     sp_scrl(100,cx_+ 89,cy_+ 91,&H14C,3)    /* "SP":オテテ
  4109.                     sp_scrl(104,cx_+ 73,cy_+ 88,&H14E,3)    /* "SP":ケムリ
  4110.                     sp_scrl(105,cx_+ 88,cy_+ 73,&H414E,3)
  4111.                     sp_out()
  4112.                 }
  4113.                 sp_scrl(101,cx_+ 88,cy_+ 88,&H156,3)    /* "SP":コクバンケシ
  4114.                 sp_scrl(100,cx_+ 90,cy_+ 90,&H14C,3)    /* "SP":オテテ
  4115.                 sp_scrl(104,cx_+ 72,cy_+ 88,&H14D,3)    /* "SP":ケムリ
  4116.                 sp_scrl(105,cx_+ 88,cy_+ 72,&H414D,3)
  4117.                 sp_out()
  4118.             } else {
  4119.                 tim_c=tim_c+1
  4120.             }
  4121.         }
  4122.     }
  4123.  
  4124.     if dbg = 1 then {
  4125.         TSP3(  8, 64,stg_cmp)
  4126.         TSP3( 40, 64,help_p)
  4127.     }
  4128. endfunc
  4129.  
  4130. /*[E]= -: Color Block(bit mode) :- ====
  4131. /*====-----------------------------====
  4132. func CLBK_BIT()
  4133.     if BT1 = 1 then {
  4134.         wk0=edit_map(cy*30+cx)
  4135.         if (wk0 and 1) = 0 then {    /* マエノジョウタイガ ビットオフ ノ トキ
  4136.             if flg_on_mode = 0 or flg_on_mode = 1 then {
  4137.                 play_se(4)
  4138.                 COL_BLK_P(1,(wk0 shr 1),cx,cy)
  4139.                 edit_map(cy*30+cx)=wk0 xor 1
  4140.                 flg_on_mode=1
  4141.             }
  4142.         } else {            /* マエノジョウタイガ ビットオン ノ トキ
  4143.             if flg_on_mode = 0 or flg_on_mode = 2 then {
  4144.                 play_se(8)
  4145.                 COL_BLK_P(0,(wk0 shr 1),cx,cy)
  4146.                 edit_map(cy*30+cx)=wk0 xor 1
  4147.                 flg_on_mode=2
  4148.             }
  4149.         }
  4150.     }
  4151.  
  4152.     if BT1 = 2 then {
  4153.         wk0=edit_map(cy*30+cx)
  4154.         if (wk0 and 1) = 1 then {    /* マエノジョウタイガ ビットオン ノ トキ
  4155.             if flg_on_mode = 0 or flg_on_mode = 1 then {
  4156.                 play_se(8)
  4157.                 COL_BLK_P(0,(wk0 shr 1),cx,cy)
  4158.                 edit_map(cy*30+cx)=wk0 xor 1
  4159.                 flg_on_mode=1
  4160.             }
  4161.         }
  4162.     }
  4163. endfunc
  4164.  
  4165. /*[E]= -: Color Block(pic mode) :- ====
  4166. /*====-----------------------------====
  4167. func CLBK_PIC()
  4168.     if BT1 = 1 then {
  4169.         wk0=edit_map(cy*30+cx)
  4170.  
  4171.         COL_BLK_P((wk0 and 1),pen_c,cx,cy)
  4172.  
  4173.         edit_map(cy*30+cx)=(pen_c shl 1)+(wk0 and 1)
  4174.     }
  4175.  
  4176.     if BT1 = 2 then {
  4177.         wk0=edit_map(cy*30+cx)
  4178.         pen_c=wk0 shr 1
  4179.         fill( 24, 56, 30, 62, 24+(pen_c shl 1))    /* para, win
  4180.         sp_col2( 7,edit_palet(pen_c),1)
  4181.     }
  4182. endfunc
  4183.  
  4184. /*[E]= -: Color Block Put :- ====
  4185. /*====-----------------------====
  4186. func COL_BLK_P(bit;char,col;char,x;char,y;char)
  4187.     apage(1)
  4188.     if bit=0 then {
  4189.         if col=0 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB0)
  4190.         if col=1 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB1)
  4191.         if col=2 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB2)
  4192.         if col=3 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB3)
  4193.         if col=4 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB4)
  4194.         if col=5 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB5)
  4195.         if col=6 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB6)
  4196.         if col=7 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CB7)
  4197.     } else {
  4198.         if col=0 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS0)
  4199.         if col=1 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS1)
  4200.         if col=2 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS2)
  4201.         if col=3 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS3)
  4202.         if col=4 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS4)
  4203.         if col=5 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS5)
  4204.         if col=6 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS6)
  4205.         if col=7 then put( 73+x*6, 73+y*6, 78+x*6, 78+y*6,CBS7)
  4206.     }
  4207.  
  4208.     apage(0)
  4209.     pset(x+  5,y+  5,(bit shl 4))
  4210.     pset(x+ 39,y+  5, 24+(col shl 1))
  4211. endfunc
  4212.  
  4213. /*[S]= -: 5マスオキ ノ ケイセン :- ====
  4214. /*====--------------------====
  4215. func KEISEN()
  4216.     wk0=xsize/5
  4217.     wk1=ysize/5
  4218. /*---- -: タテ ノ ケイセン :- ----
  4219.     if wk0 >= 2 then {
  4220.         for i=1 to wk0-1
  4221.             tline(i*30+ 72, 72,i*30+ 72,wk1*30+ 72, 3)
  4222.         next
  4223.     }
  4224. /*---- -: ヨコ ノ ケイセン :- ----
  4225.     if wk1 >= 2 then {
  4226.         for i=1 to wk1-1
  4227.             tline( 72,i*30+ 72,wk0*30+ 72,i*30+ 72, 3)
  4228.         next
  4229.     }
  4230. endfunc
  4231.  
  4232. /*[S]= -: Press Button :- ====
  4233. /*====--------------------====
  4234. func PRS_BT(pn;char,x;char,y;char)
  4235.     bton=kstrig(1)
  4236.     while 1
  4237.         BT1=kstrig(1)
  4238.  
  4239. /*---- -: push anime :- ----
  4240.         piko(0)=piko(0)+1 and 15
  4241.         if piko(0) = 0 then {
  4242.             piko(1)=piko(1)+1 and 1
  4243.             sp_scrl(pn  ,x+16,y+ 4+(piko(1) shl 1),&H16F,3)
  4244.             sp_scrl(pn+1,x+16,y+16,&H16D+piko(1),3)
  4245.         }
  4246.  
  4247. /*++++ -: ボタン ガ オサレタトキ :- ++++
  4248.         if BT1 <> 0 and bton = 0 then {
  4249.             play_se(3)
  4250.             break
  4251.         }
  4252.  
  4253.         if bton <> BT1 then bton=0
  4254.  
  4255.         sp_out()
  4256.     endwhile
  4257.     sp_scrl(pn  ,0,0,0,0)
  4258.     sp_scrl(pn+1,0,0,0,0)
  4259.     sp_out()
  4260. endfunc
  4261.  
  4262. /*[S]= -: Text Screen On/Off :- ====
  4263. /*====--------------------------====
  4264. func TX_DISP(fl;char)
  4265.     v_disp()
  4266.     thome(256-(fl shl 8),  0)
  4267. endfunc
  4268.  
  4269. /*[S]= -: Screen All Off :- ====
  4270. /*====----------------------====
  4271. func SCR_ALL_OFF()
  4272.     TX_DISP(0)
  4273.     vpage(0)
  4274.     sp_disp(0)
  4275.     apage(0)
  4276.     fill(  0,  0,255,255,  0)
  4277.     tfill(  0,  0,255,255, 0)
  4278.     for i=0 to 127
  4279.         sp_scrl(i,0,0,0,0)
  4280.     next
  4281.     sp_out()
  4282. endfunc
  4283.  
  4284. /*[G]= -: Back Palet Set :- ====
  4285. /*====----------------------====
  4286. func BK_PAL_SET()
  4287.     if stg_p = 0 then {
  4288.         PL_S(  1,rgb(25,24,18))        /* block pal.
  4289.         PL_S(  2,rgb(23,21,16))
  4290.         PL_S(  3,rgb(21,19,14))
  4291.         PL_S(  4,rgb(19,17,12))
  4292.         PL_S(  5,rgb(17,15,10))
  4293.         PL_S(  6,rgb(15,13, 8))
  4294.         wk0=rgb(12,22,12)
  4295.     }
  4296.     if stg_p = 1 then {
  4297.         PL_S(  1,rgb(25,25,23))
  4298.         PL_S(  2,rgb(23,23,21))
  4299.         PL_S(  3,rgb(20,20,19))
  4300.         PL_S(  4,rgb(17,17,17))
  4301.         PL_S(  5,rgb(14,14,15))
  4302.         PL_S(  6,rgb(11,11,13))
  4303.         wk0=rgb(11,18,23)
  4304.     }
  4305.     if stg_p = 2 then {
  4306.         PL_S(  1,rgb(25,24,23))
  4307.         PL_S(  2,rgb(23,22,21))
  4308.         PL_S(  3,rgb(20,19,18))
  4309.         PL_S(  4,rgb(17,16,15))
  4310.         PL_S(  5,rgb(14,13,12))
  4311.         PL_S(  6,rgb(11,10, 9))
  4312.         wk0=rgb(12,22,19)
  4313.     }
  4314.     if stg_p = 3 then {
  4315.         PL_S(  1,rgb(25,25,20))
  4316.         PL_S(  2,rgb(22,22,17))
  4317.         PL_S(  3,rgb(19,19,14))
  4318.         PL_S(  4,rgb(16,16,11))
  4319.         PL_S(  5,rgb(13,13, 8))
  4320.         PL_S(  6,rgb(10,10, 5))
  4321.         wk0=rgb(18,13,23)
  4322.     }
  4323.     PL_S(  9,wk0)                /* line cursole
  4324.     sp_col2( 3,wk0, 0)
  4325.     PAL(6)=wk0 shr 8
  4326.     PAL(7)=wk0 and &HFF
  4327.     sp_out()
  4328.     stg_p=stg_p+1 and 3
  4329. endfunc
  4330.  
  4331. /*[I]= -: Screen Make :- ====
  4332. /*====-------------------====
  4333. func SCR_MK1()
  4334. /*---- -: main screen :- ----
  4335.     apage(1)                /* active"1" make.
  4336.     fill(  0,  0,255,255,  4)        /* back
  4337.     line(  1,  1,  1,253, 12)
  4338.     line(  1,  1,253,  1, 12)
  4339. /*    line(254,  2,254,254,  2)
  4340. /*    line(  2,254,254,254,  2)
  4341.  
  4342.     for i=0 to 14                /* ヒント ヒョウジラン
  4343.         fill(i*12+ 73,  3,i*12+ 78, 68,  6)
  4344.         fill(i*12+ 79,  3,i*12+ 84, 68,  4)
  4345.  
  4346.         fill(  3,i*12+ 73, 68,i*12+ 78,  6)
  4347.         fill(  3,i*12+ 79, 68,i*12+ 84,  4)
  4348.     next
  4349. /*    for i=0 to 511                /* ヨゴレ ヲ イレル
  4350. /*        wk0=rand() and &HFF
  4351. /*        wk1=rand() and &HFF
  4352. /*        wk2=point(wk0,wk1)
  4353. /*        if wk2 = 12 then wk2=10
  4354. /*        pset(wk0,wk1,wk2+2)
  4355. /*    next
  4356.     for i=0 to 2                /* ヒント 5マスオキ ケイセン
  4357.         wk0=102+i*60
  4358.         line(wk0   ,  3,wk0   , 68,  8,&H5555)
  4359.         line(wk0+30,  3,wk0+30, 68,  6,&H5555)
  4360.  
  4361.         line(  3,wk0   , 68,wk0   ,  8,&H5555)
  4362.         line(  3,wk0+30, 68,wk0+30,  6,&H5555)
  4363.     next
  4364. /*    KEISEN()                /* 5マスオキ ノ ケイセン
  4365.  
  4366.     for i=0 to 29                /* カーソルイチ ランプ
  4367.         wk0=73+i*6
  4368.         put(wk0, 69,wk0+5, 72,MK0)
  4369.         put( 69,wk0, 72,wk0+5,MK1)
  4370.     next
  4371.     pset( 72, 72, 16)
  4372.  
  4373. /*---- -: title :- ----
  4374.     apage(1)                /* active "1" make.
  4375.     sp_pat(&H3F,wkA,1) : put(496,240,511,255,wkA)
  4376.  
  4377.     for i=0 to 15
  4378.         wk0=(i shl 4)
  4379.         for j=0 to 15
  4380.             wk1=256+(j shl 4)
  4381.             wk2=point(496+j,240+i)
  4382.             if wk2 = 0 then put(wk1,wk0,wk1+15,wk0+15,TBK0)
  4383.             if wk2 = 1 then put(wk1,wk0,wk1+15,wk0+15,TBK0_)
  4384.             if wk2 = 2 then put(wk1,wk0,wk1+15,wk0+15,TBK1)
  4385.             if wk2 = 3 then put(wk1,wk0,wk1+15,wk0+15,TBK1_)
  4386.             if wk2 = 4 then put(wk1,wk0,wk1+15,wk0+15,TBK2)
  4387.             if wk2 = 5 then put(wk1,wk0,wk1+15,wk0+15,TBK2_)
  4388.             if wk2 = 6 then put(wk1,wk0,wk1+15,wk0+15,TBK3)
  4389.             if wk2 = 7 then put(wk1,wk0,wk1+15,wk0+15,TBK3_)
  4390.             if wk2 = 8 then put(wk1,wk0,wk1+15,wk0+15,TBK3__)
  4391.             if wk2 = 9 then put(wk1,wk0,wk1+15,wk0+15,TBK4)
  4392.             if wk2 =10 then put(wk1,wk0,wk1+15,wk0+15,TBK4_)
  4393.             if wk2 =11 then put(wk1,wk0,wk1+15,wk0+15,TBK4__)
  4394.         next
  4395.     next
  4396.  
  4397.     for i=0 to 17
  4398.         line(455+i,  0,511, 56-i,rb_p(i))
  4399.         line(256,199+i,312-i,255,rb_p(i))
  4400.     next
  4401.  
  4402. /*---- -: problem select :- ----
  4403.     apage(0)                /* active "0" make.
  4404.     line(264, 11,503, 11,164)        /* logo line
  4405.     line(265, 12,502, 12,164)
  4406.     line(268, 15,507, 15,177)
  4407.     line(269, 16,506, 16,177)
  4408.  
  4409.     fill(272, 24,343, 95,177)        /* カンセイズ
  4410. /*    box(275, 27,340, 92,  0)
  4411.  
  4412.     for i=0 to 15                /* サンカク ヤジルシ
  4413.         line(288-i, 96+i,288+i, 96+i,177)
  4414.         line(284-i, 92+i,284+i, 92+i,164)
  4415.     next
  4416.  
  4417.     fill(392, 39,507, 60,177)        /* モンダイ ノ ダイメイ
  4418.     for i=0 to 6
  4419.         put(392+(i shl 4), 40,407+(i shl 4), 55,BK0)
  4420.     next
  4421.  
  4422.     fill(348,100,507,255,177)        /* モンダイ ノ クリア ジョウキョウ
  4423.     for i=0 to 9
  4424.         wk0=96+(i shl 4)
  4425.         for j=0 to 9
  4426.             wk1=344+(j shl 4)
  4427.             put(wk1,wk0,wk1+15,wk0+15,PROB0)
  4428.         next
  4429.     next
  4430.  
  4431. /*---- -: font list :- ----
  4432.     apage(0)                /* active "0" make.
  4433.     for i=0 to 11                /* input title ワク
  4434.         wk0=i*20+10
  4435.         fill(wk0+2,266,wk0+17,289,177)
  4436.         put(wk0,264,wk0+15,279,BK0)
  4437.         put(wk0,280,wk0+15,295,BK0)
  4438.     next
  4439.     fill(  0,288,255,295,  0)        /* list up
  4440.     for i=0 to 13
  4441.         wk0=288+(i shl 4)
  4442.         for j=0 to 15
  4443.             wk1=(j shl 4)
  4444.             put(wk1,wk0,wk1+15,wk0+15,BK0)
  4445.         next
  4446.     next
  4447.     fill(  0,256,  3,511,  0)
  4448.     fill(252,256,255,511,  0)
  4449.     fill(  0,504,255,511,  0)
  4450.     fill(252,290,253,505,177)
  4451.     fill(  6,504,253,505,177)
  4452.  
  4453.     for i=0 to 11                /* input title ワク(text)
  4454.         wk0=i*20+10
  4455.         tfill(wk0  ,264,wk0+15,287, 8)
  4456.         tfill(wk0+1,265,wk0+14,286,15)
  4457.         tfill(wk0+2,266,wk0+13,285, 8)
  4458.         tfill(wk0+3,267,wk0+12,284, 0)
  4459.     next
  4460.     tfill(  4,288,251,503, 8)        /* list up ワク(text)
  4461.     tfill(  5,289,250,502,15)
  4462.     tfill(  6,290,249,501, 8)
  4463.     tfill(  7,291,248,500, 0)
  4464.  
  4465.     for i=0 to 12                /* font list up
  4466.     for j=0 to 19
  4467.         TFP2( 10+j*12,292+(i shl 4),fnt_l(i*20+j))
  4468.     next
  4469.     next
  4470.     TFP2(202,484,&H110)            /* <-,->,bs,end
  4471.     TFP2(214,484,&H111)
  4472.     TFP2(226,484,&H112)
  4473.     TFP2(238,484,&H113)
  4474.  
  4475.     TFP(  8,256,"TITLE_INPUT")
  4476.     TFP(  4,504,"SELECT\JOY[STICK_INPUT\A[BUTTON")
  4477.  
  4478. /*---- -: complete :- ----
  4479.     apage(1)                /* active "1" make.
  4480.     for i=0 to 7                /* back 4(レンガ)
  4481.         wk0=(i shl 5)+256
  4482.         for j=0 to 7
  4483.             wk1=(j shl 5)+256
  4484.             put(wk1,wk0,wk1+31,wk0+31,BK4)
  4485.         next
  4486.     next
  4487.     for i=0 to 11                /* グラデーション
  4488.         fill(320,272+(i shl 4),495,279+(i shl 4),  0)
  4489.         fill(312,280+(i shl 4),503,287+(i shl 4),  0)
  4490.     next
  4491.     for i=0 to 21
  4492.         put(320+(i shl 3),400,327+(i shl 3),463,DSP_BK)
  4493.     next
  4494.     for i=0 to 3
  4495.         wk0=408+(i shl 4)
  4496.         get(320,wk0,327,wk0+7,wk9)
  4497.  
  4498.         put(312,wk0,319,wk0+7,wk9)
  4499.         put(496,wk0,503,wk0+7,wk9)
  4500.     next
  4501.  
  4502.     fill(336,480,479,487, 84)        /* stage title
  4503.     fill(344,488,471,495, 84)
  4504.     fill(336,496,479,503, 84)
  4505.  
  4506.     for i=0 to 17
  4507.         line(256,447+i,320-i,511,rb_p(i))
  4508.     next
  4509.  
  4510. /*---- -: rule display :- ----
  4511.     apage(0)
  4512.     RULE_S1(260, 5,  0)
  4513.  
  4514.     RULE_S1(280,15,  6)
  4515.     RULE_S1(296, 9, 22)
  4516.  
  4517.     RULE_S1(316,15, 32)
  4518.     RULE_S1(332,15, 48)
  4519.  
  4520.     RULE_S1(352,15, 64)
  4521.     RULE_S1(368,11, 80)
  4522.  
  4523.     RULE_S1(388,15, 92)
  4524.     RULE_S1(404,15,108)
  4525.     RULE_S1(420,15,124)
  4526.     RULE_S1(436, 6,140)
  4527.  
  4528.     RULE_S1(456,15,147)
  4529.     RULE_S1(472,15,163)
  4530.  
  4531.     RULE_S1(492,15,179)
  4532. endfunc
  4533.  
  4534. /*[S]= -: key borad buffer clear :- ====
  4535. /*====------------------------------====
  4536. func kb_cls()
  4537.     while 1
  4538.         if inkey$(0) = "" then break
  4539.     endwhile
  4540. endfunc
  4541.  
  4542. /*[S]= -: Key Board & Stick & Mouse Input Check :- ====
  4543. /*====---------------------------------------------====
  4544. func ST_INP()
  4545.     ST1=k8stick(1)
  4546.     BT1=kstrig(1)
  4547.     kyb=asc(inkey$(0))
  4548. endfunc
  4549.  
  4550. /*[S]= -: スティック ノ ニュウリョク アトショリ :- ====
  4551. /*====----------------------------====
  4552. func ST_CK2(fl0;char,fl1;char)
  4553.     if sths <> ST1 then {
  4554.         ston=0
  4555.         stot=0
  4556.         sttmf=0
  4557.     } else {
  4558.         ston=1
  4559.     }
  4560.     if ston <> 0 and sths = ST1 then {
  4561.         stot=stot+1
  4562.         if sttmf = 0 then {
  4563.             if stot = fl0 then {
  4564.                 ston=0
  4565.                 stot=0
  4566.                 sttmf=1
  4567.             }
  4568.         } else {
  4569.             if stot = fl1 then {
  4570.                 ston=0
  4571.                 stot=0
  4572.             }
  4573.         }
  4574.     }
  4575.     sths=ST1
  4576. endfunc
  4577.  
  4578. /*[S]= -: Text Font Put :- ====
  4579. func TFP(x;int,y;int,m;str)
  4580.     for i=0 to len(m)-1
  4581.         wk0=asc(mid$(m,i+1,1))+&H10
  4582.         sp_pat(wk0,wk9,0)
  4583.         tput(x,y,8,8,wk9,"pset")
  4584.         x=x+8
  4585.     next
  4586. endfunc
  4587. /*[S]= -: Text スウジ Put :- ====
  4588. func TSP(x;int,y;int,n;char)
  4589.     if n <= 9 then {
  4590.         sp_pat(&H40,wk9,0)
  4591.         tput(x  ,y,8,8,wk9,"pset")
  4592.         sp_pat(&H40+n,wk9,0)
  4593.         tput(x+8,y,8,8,wk9,"pset")
  4594.     } else {
  4595.         if n >= 100 then n=99
  4596.  
  4597.         wk0=atoi(mid$(itoa(n),1,1))
  4598.         sp_pat(&H40+wk0,wk9,0)
  4599.         tput(x  ,y,8,8,wk9,"pset")
  4600.         wk0=atoi(mid$(itoa(n),2,1))
  4601.         sp_pat(&H40+wk0,wk9,0)
  4602.         tput(x+8,y,8,8,wk9,"pset")
  4603.     }
  4604. endfunc
  4605. func TSP3(x;int,y;int,n;int)
  4606.     if n <= 9 then {
  4607.         sp_pat(&H40,wk9,0)
  4608.         tput(x   ,y,8,8,wk9,"pset")
  4609.         tput(x+ 8,y,8,8,wk9,"pset")
  4610.         sp_pat(&H40+n,wk9,0)
  4611.         tput(x+16,y,8,8,wk9,"pset")
  4612.     }
  4613.     if n >= 10 and n <= 99 then {
  4614.         sp_pat(&H40,wk9,0)
  4615.         tput(x   ,y,8,8,wk9,"pset")
  4616.         wk0=atoi(mid$(itoa(n),1,1))
  4617.         sp_pat(&H40+wk0,wk9,0)
  4618.         tput(x+ 8,y,8,8,wk9,"pset")
  4619.         wk0=atoi(mid$(itoa(n),2,1))
  4620.         sp_pat(&H40+wk0,wk9,0)
  4621.         tput(x+16,y,8,8,wk9,"pset")
  4622.     }
  4623.     if n >= 100 then {
  4624.         if n >= 1000 then n=999
  4625.  
  4626.         wk0=atoi(mid$(itoa(n),1,1))
  4627.         sp_pat(&H40+wk0,wk9,0)
  4628.         tput(x   ,y,8,8,wk9,"pset")
  4629.         wk0=atoi(mid$(itoa(n),2,1))
  4630.         sp_pat(&H40+wk0,wk9,0)
  4631.         tput(x+ 8,y,8,8,wk9,"pset")
  4632.         wk0=atoi(mid$(itoa(n),3,1))
  4633.         sp_pat(&H40+wk0,wk9,0)
  4634.         tput(x+16,y,8,8,wk9,"pset")
  4635.     }
  4636. endfunc
  4637. /*[S]= -: Text Font Put(8x16) :- ====
  4638. func TFP2(x;int,y;int,cd;int)
  4639.     wk0=cd shr 1
  4640.     wk1=cd and 1
  4641.  
  4642.     sp_pcg(&H3F,PCG1,&H98+wk0)        /* フォント パターン ヨウイ
  4643.     sp_out()
  4644.  
  4645.     sp_pat(&HFC+(wk1 shl 1),wk9,0)        /* フォント プット
  4646.     tput(x,y,8,8,wk9,"pset")
  4647.     sp_pat(&HFD+(wk1 shl 1),wk9,0)
  4648.     tput(x,y+8,8,8,wk9,"pset")
  4649. endfunc
  4650. /*[S]= -: Sprite スウジ Put :- ====
  4651. func SSP2(pn;char,x;int,y;int,n;int,p_c;int,on;char)
  4652.     if n <= 9 then {
  4653.         sp_scrl(pn  ,x  ,y,p_c,on)
  4654.         sp_scrl(pn+1,x+8,y,p_c+n,3)
  4655.     }
  4656.     if n >= 10 then {
  4657.         if n >= 100 then n=99
  4658.  
  4659.         wk0=atoi(mid$(itoa(n),1,1))
  4660.         sp_scrl(pn  ,x  ,y,p_c+wk0,3)
  4661.         wk0=atoi(mid$(itoa(n),2,1))
  4662.         sp_scrl(pn+1,x+8,y,p_c+wk0,3)
  4663.     }
  4664. endfunc
  4665. func SSP3(pn;char,x;int,y;int,n;int,p_c;int,on;char)
  4666.     if n <= 9 then {
  4667.         sp_scrl(pn  ,x   ,y,p_c,on)
  4668.         sp_scrl(pn+1,x+ 8,y,p_c,on)
  4669.         sp_scrl(pn+2,x+16,y,p_c+n,3)
  4670.     }
  4671.     if n >= 10 and n <= 99 then {
  4672.         sp_scrl(pn  ,x   ,y,p_c,on)
  4673.         wk0=atoi(mid$(itoa(n),1,1))
  4674.         sp_scrl(pn+1,x+ 8,y,p_c+wk0,3)
  4675.         wk0=atoi(mid$(itoa(n),2,1))
  4676.         sp_scrl(pn+2,x+16,y,p_c+wk0,3)
  4677.     }
  4678.     if n >= 100 then {
  4679.         if n >= 1000 then n=999
  4680.  
  4681.         wk0=atoi(mid$(itoa(n),1,1))
  4682.         sp_scrl(pn  ,x   ,y,p_c+wk0,3)
  4683.         wk0=atoi(mid$(itoa(n),2,1))
  4684.         sp_scrl(pn+1,x+ 8,y,p_c+wk0,3)
  4685.         wk0=atoi(mid$(itoa(n),3,1))
  4686.         sp_scrl(pn+2,x+16,y,p_c+wk0,3)
  4687.     }
  4688. endfunc
  4689.  
  4690. /*[S]= -: Time Counter Display :- ====
  4691. /*====----------------------------====
  4692. func TIM_P1()
  4693.     tim_w=tim_c / 60
  4694.     if inft = 0 then {
  4695.         SSP2( 88, 36, 44,tim_w / 60,&H230,0)    /* min.
  4696.         SSP2( 90, 60, 44,tim_w mod 60,&H230,3)    /* sec.
  4697.     } else {
  4698.         SSP2( 88, 52, 26,tim_w / 60,&H230,0)
  4699.         SSP2( 90, 54, 44,tim_w mod 60,&H230,3)
  4700.     }
  4701. endfunc
  4702.  
  4703. /*[I]= -: Screen Initialize :- ====
  4704. /*====-------------------------====
  4705. func SCR_INIT()
  4706.     screen 0,2,1,1
  4707. /*    iocs(&H10,&H38):iocs(&H90)
  4708.     console ,,0
  4709.     contrast(0)
  4710.     v_priority("STG","01")            /* プライオリティ (SP>TX>GR)
  4711.     v_special(3)                /* ハントウメイ (ベース+セカンド)
  4712.     window(  0,  0,511,511)
  4713.     home(0,  0,  0)
  4714.     home(1,  0,  0)
  4715.     vpage(0)
  4716.     apage(0)
  4717.     tcls()
  4718.     thome(256,  0)
  4719.     tfill(256,  0,767,767, 8)
  4720.     TX_DISP(0)
  4721.     sp_init()
  4722.     sp_disp(0)
  4723.     mouse(0)
  4724.     mouse(4)
  4725.     m_stop()
  4726.  
  4727.     toroku_zmd( zmd_list )
  4728.     play_zmd( 0 )
  4729. endfunc
  4730.  
  4731. /*[I]= -: Grpahics Palet Set :- ====
  4732. /*====--------------------------====
  4733. func GPAL_SET()
  4734.     PL_S(  0,0)
  4735.     PL_S(  1,rgb(25,24,18))            /* block pal.
  4736.     PL_S(  2,rgb(23,21,16))
  4737.     PL_S(  3,rgb(21,19,14))
  4738.     PL_S(  4,rgb(19,17,12))
  4739.     PL_S(  5,rgb(17,15,10))
  4740.     PL_S(  6,rgb(15,13, 8))
  4741.     PL_S(  7,rgb(15,15,15))
  4742.     PL_S(  8,rgb(12,12,12))
  4743.     PL_S(  9,rgb( 0,15,25))            /* line
  4744.     PL_S( 10,rgb( 0,15,25))            /* back(window)
  4745.     PL_S( 11,rgb( 0,12,23))
  4746.     PL_S( 12,rgb( 1, 1, 1))            /* block(color) pal.
  4747.     PL_S( 13,rgb( 1,15,30))
  4748.     PL_S( 14,rgb(30,10,10))
  4749.     PL_S( 15,rgb(30,10,30))
  4750.     PL_S( 16,rgb( 1,27, 1))
  4751.     PL_S( 17,rgb( 1,29,30))
  4752.     PL_S( 18,rgb(30,29, 1))
  4753.     PL_S( 19,rgb(30,30,30))
  4754.     PL_S( 20,rgb(18,19,14))            /* back 2
  4755.     PL_S( 21,rgb(15,17,13))
  4756.     PL_S( 22,rgb(12,15,12))
  4757.     PL_S( 23,rgb( 9,13,11))
  4758.     PL_S( 24,rgb( 6,11,10))
  4759.     PL_S( 25,rgb(28,20,20))            /* title sub
  4760.     PL_S( 26,rgb(28,27,20))
  4761.     PL_S( 27,rgb(25,20, 0))            /* report
  4762.     PL_S( 28,rgb(23,18, 0))
  4763.     PL_S( 29,rgb(21,16, 0))
  4764.     PL_S( 30,rgb(19,14, 0))
  4765.     PL_S( 31,rgb( 0,13,10))
  4766.     PL_S( 32,rgb( 0,10, 5))
  4767.     PL_S( 33,rgb(19,25,24))
  4768.     PL_S( 34,rgb(16,23,22))
  4769.     PL_S( 35,rgb(13,21,20))
  4770.     PL_S( 36,rgb(20,18,16)) /* 20,14,15    /* back 4(レンガ)
  4771.     PL_S( 37,rgb(17,16,15)) /* 18,12,13
  4772.     PL_S( 38,rgb(14,14,14)) /* 16,10,11
  4773.     PL_S( 39,rgb(11,12,13)) /* 14, 8, 9
  4774.     PL_S( 40,rgb( 8,10,12)) /* 12, 6, 7
  4775.     PL_S( 41,rgb( 5, 8,11)) /* 10, 4, 5
  4776.     PL_S( 42,rgb(14,13,13)) /* 13,14,15
  4777.     PL_S( 43,rgb(12,10,10)) /* 12,13,14
  4778.     PL_S( 44,rgb(23,24,24))            /* demo ワク(color)
  4779.     PL_S( 45,rgb(21,22,22))
  4780.     PL_S( 46,rgb(29,24,24))
  4781.     PL_S( 47,rgb(27,22,22))
  4782.     PL_S( 48,rgb(28,28,23))
  4783.     PL_S( 49,rgb(26,26,21))
  4784.     PL_S( 50,rgb(23,28,23))
  4785.     PL_S( 51,rgb(21,26,21))
  4786.     PL_S( 52,rgb(24,24,29))
  4787.     PL_S( 53,rgb(22,22,27))
  4788.     PL_S( 54,rgb(13,14,14))
  4789.     PL_S( 55,rgb(15, 0,15))            /* complete back
  4790.     PL_S( 56,rgb(13, 0,13))
  4791.     PL_S( 57,rgb(11, 0,11))
  4792.     PL_S( 58,rgb( 9, 0, 9))
  4793.     PL_S( 59,rgb( 7, 0, 7))
  4794.     PL_S( 60,rgb( 5, 0, 5))
  4795.     PL_S( 61,rgb( 3, 0, 3))
  4796.     PL_S( 62,rgb( 1, 0, 1))
  4797.     PL_S( 63,rgb(30,30,30))            /* イチゴ
  4798.     PL_S( 64,rgb(26,27,25))
  4799.     PL_S( 65,rgb(30,20,20))
  4800.     PL_S( 66,rgb(25,15,15))
  4801.     PL_S( 67,rgb( 0,25, 0))
  4802.     PL_S( 68,rgb(15,25,15))
  4803.     PL_S( 69,rgb(30,26,30))            /* title
  4804.     PL_S( 70,rgb(29,23,28))
  4805.     PL_S( 71,rgb(28,20,26))
  4806.     PL_S( 72,rgb(30,30,30))
  4807.     PL_S( 73,rgb(25,26,30))
  4808.     PL_S( 74,rgb(22,23,28))
  4809.     PL_S( 75,rgb(19,20,26))
  4810.     PL_S( 76,rgb(28,29,30))
  4811.     PL_S( 77,rgb(14,15,16))
  4812.     PL_S( 78,rgb(14,14,14))
  4813.     PL_S( 79,rgb(31,29,30))
  4814.     PL_S( 80,rgb(25,25,25))
  4815.     PL_S( 81,rgb(20,21,20))
  4816.     PL_S( 82,rgb(30, 0, 0))            /* problem select
  4817.     PL_S( 83,rgb(26, 0, 0))
  4818.     PL_S( 84,rgb(28,28,18))            /* problem title
  4819.     PL_S( 85,rgb(22,22,18))
  4820.     PL_S( 86,rgb(20,20,18))
  4821.     PL_S( 87,rgb(18,18,18))
  4822.     PL_S( 88,rgb( 1, 1, 1))            /* title shadow
  4823.     PL_S( 89,rgb( 2, 2, 2))
  4824.     PL_S( 90,rgb( 4, 4, 4))
  4825.     PL_S( 91,rgb( 6, 6, 6))
  4826.     PL_S( 92,rgb( 8, 8, 8))
  4827.     PL_S( 93,rgb(10,10,10))
  4828.     PL_S( 94,rgb(12,12,12))
  4829.     PL_S( 95,rgb(14,14,14))
  4830.     PL_S( 96,rgb(16,16,16))
  4831.     PL_S( 97,rgb(18,18,18))
  4832.     PL_S( 98,rgb(20,20,20))
  4833.     PL_S( 99,rgb(22,22,22))
  4834.     PL_S(100,rgb(24,24,24))
  4835.     PL_S(101,rgb(26,26,26))
  4836.     PL_S(102,rgb(28,28,28))
  4837.     PL_S(103,rgb(30,30,30))
  4838.     PL_S(104,rgb( 9, 0, 0))            /* problem list
  4839.     PL_S(105,rgb(11, 0, 0))
  4840.     PL_S(106,rgb(13, 0, 0))
  4841.     PL_S(107,rgb(15, 0, 0))
  4842.     PL_S(108,rgb(17, 0, 1))
  4843.     PL_S(109,rgb(19, 3, 4))
  4844.     PL_S(110,rgb(21, 6, 7))
  4845.     PL_S(111,rgb(23, 9,10))
  4846.     PL_S(112,rgb(25,12,13))
  4847.     PL_S(113,rgb(20,28,26))            /* back 3
  4848.     PL_S(114,rgb(30,26,28))
  4849.     PL_S(115,rgb(24,26,30))
  4850.     PL_S(116,rgb(24,30,26))
  4851.     PL_S(117,rgb(30,30,26))
  4852.     PL_S(118,rgb(16,18,24))            /* comp. 1st.
  4853.     PL_S(119,rgb(14,16,22))
  4854.     PL_S(120,rgb(12,14,20))
  4855.     PL_S(121,rgb(10,12,18))
  4856.     PL_S(122,rgb( 8,10,16))
  4857.     PL_S(123,rgb( 6, 8,14))
  4858.     PL_S(124,rgb( 4, 6,12))
  4859.     PL_S(125,rgb( 2, 4,10))
  4860. endfunc
  4861. func PL_S(n;char,cl;int)
  4862.     palet((n shl 1)  ,cl)
  4863.     palet((n shl 1)+1,cl)
  4864. endfunc
  4865.  
  4866. /*[I]= -: PCG Set :- ====
  4867. /*====---------------====
  4868. func PCG_SET()
  4869.     for i=0 to 8
  4870.         sp_palet(i,PAL,i)
  4871.         sp_col2(0,0,i)
  4872.     next
  4873.     for i=0 to 151
  4874.         sp_pcg(i,PCG1,i)
  4875.     next
  4876.     sp_out()
  4877. endfunc
  4878.  
  4879. /*[I]= -: Data Read :- ====
  4880. /*====-----------------====
  4881. func DATA_READ()
  4882. /*---- -: モンダイ ファイルメイ チェック :- ----
  4883.     if b_argc = 2 then {
  4884.         stg_fl=b_argv(b_argc-1)
  4885.     } else {
  4886.         stg_fl=getenv("PXFILE")
  4887.         if stg_fl = "" then stg_fl=getenv("pxfile")
  4888.         if stg_fl = "" then stg_fl="PX_STG0"
  4889.     }
  4890.     print "PROBLEM FILE = ";stg_fl;".DAT"
  4891.  
  4892. /*---- -: トチュ セーブデータ ガ アルカ チェック :- ----
  4893.     ldok=filesnum(stg_fl+".RES",&H20)
  4894.     print "Resume File = ";
  4895.     if ldok <> 0 then print "Found!" else print "Missing!"
  4896.  
  4897. /*---- -: カキコミ デキルカ チェック :- ----
  4898.     if drvctrl(7) = &HF5 or (drvctrl(0) and 4) = 1 then {
  4899.         dskok=0
  4900.         print "プレイデータを更新しません。"
  4901.     } else {
  4902.         dskok=1
  4903.         print "プレイデータを自動更新します。"
  4904.     }
  4905.  
  4906. /*---- -: カクシュ データ ヨミコミ :- ----
  4907.     wk0=fopen("PX      .PAL","r")
  4908.     fread(PAL,288,wk0)
  4909.     fclose(wk0)
  4910.  
  4911.     wk0=fopen("PX      .OBJ","r")
  4912.     fread(PCG1,37120,wk0)
  4913.     fclose(wk0)
  4914.  
  4915.     wk0=fopen("PX      .GRD","r")
  4916.     fread(BLK0,36,wk0)
  4917.     fread(BLK1,36,wk0)
  4918.     fread(BLK2,36,wk0)
  4919.     fread(MK0,24,wk0)
  4920.     fread(MK1,24,wk0)
  4921.     fread(PEK,900,wk0)
  4922.  
  4923.     fread(CB0,36,wk0)            /* bit off block (color)
  4924.     fread(CB1,36,wk0)
  4925.     fread(CB2,36,wk0)
  4926.     fread(CB3,36,wk0)
  4927.     fread(CB4,36,wk0)
  4928.     fread(CB5,36,wk0)
  4929.     fread(CB6,36,wk0)
  4930.     fread(CB7,36,wk0)
  4931.     fread(CBS0,36,wk0)            /* bit on block (color)
  4932.     fread(CBS1,36,wk0)
  4933.     fread(CBS2,36,wk0)
  4934.     fread(CBS3,36,wk0)
  4935.     fread(CBS4,36,wk0)
  4936.     fread(CBS5,36,wk0)
  4937.     fread(CBS6,36,wk0)
  4938.     fread(CBS7,36,wk0)
  4939.  
  4940.     fread(BK0,256,wk0)            /* window back
  4941.  
  4942.     fread(BK2,256,wk0)            /* ナナメ モヨウ
  4943.     fread(BK2_,256,wk0)
  4944.  
  4945.     fread(BK3,256,wk0)
  4946.     fread(BK3_,256,wk0)
  4947.  
  4948.     fread(BK4,1024,wk0)            /* レンガ
  4949.     fread(BK4S0,128,wk0)
  4950.     fread(BK4S1,128,wk0)
  4951.  
  4952.     fread(BK5,256,wk0)            /* イチゴ
  4953.     fread(BK5_,256,wk0)
  4954.  
  4955.     fread(TBK0,256,wk0)            /* title back
  4956.     fread(TBK0_,256,wk0)
  4957.     fread(TBK1,256,wk0)
  4958.     fread(TBK1_,256,wk0)
  4959.     fread(TBK2,256,wk0)
  4960.     fread(TBK2_,256,wk0)
  4961.     fread(TBK3,256,wk0)
  4962.     fread(TBK3_,256,wk0)
  4963.     fread(TBK3__,256,wk0)
  4964.     fread(TBK4,256,wk0)
  4965.     fread(TBK4_,256,wk0)
  4966.     fread(TBK4__,256,wk0)
  4967.  
  4968.     fread(REPT0,64,wk0)            /* inf.ワク
  4969.     fread(REPT1,64,wk0)
  4970.     fread(REPT2,64,wk0)
  4971.     fread(REPT3,64,wk0)
  4972.     fread(REPT4,64,wk0)
  4973.     fread(REPT5,64,wk0)
  4974.     fread(REPT6,64,wk0)
  4975.     fread(REPT7,64,wk0)
  4976.  
  4977.     fread(HLPM,896,wk0)            /* help mater
  4978.  
  4979.     fread(DSP_MN,1600,wk0)            /* disp. window
  4980.     fread(DSP_CL,1600,wk0)
  4981.     fread(DSP_BK,512,wk0)
  4982.  
  4983.     fread(PROB0,256,wk0)            /* problem list
  4984.     fread(PROB1,256,wk0)
  4985.  
  4986.     fread(FLW,256,wk0)
  4987.     fread(NOP,256,wk0)
  4988.     fread(stg_data,512,wk0)
  4989.     fclose(wk0)
  4990.     for i=0 to 255
  4991.         wk0=stg_data(i shl 1)
  4992.         wk1=stg_data((i shl 1)+1)
  4993.         R_TXT(i)=(wk0 shl 8)+wk1
  4994.     next
  4995.  
  4996.     wk0=fopen(stg_fl+".DAT","r")
  4997.     fread(stg_data,51200,wk0)
  4998.     fclose(wk0)
  4999.  
  5000. /*    wk0=fopen("PX_USR  .DAT","r")
  5001. /*    fread(user_data,51200,wk0)
  5002. /*    fclose(wk0)
  5003.     for i=0 to 15
  5004.         stg_name(i)=&HFF
  5005.     next
  5006.     for i=0 to 899
  5007.         edit_map(i)=0
  5008.     next
  5009.     for j=0 to 99
  5010.         EDIT_SAVE(0)
  5011.         user_data((stage shl 9)  )=0
  5012.         user_data((stage shl 9)+1)=0
  5013.         stage=stage+1
  5014.     next
  5015.     stage=0
  5016. endfunc
  5017.